Array Index Out Of Bounds Exception

In my display function why showing this error (ArrayIndexOutOfBoundsException: Index 2 out of bounds for length 2)

int[][] arr= new int[3][3];
// arr[0][0]=10;
// arr[2][0]=30;

	// int[][] arr=new int[][3];
	int[][] arr = new int[3][];

	arr[0] = new int[4];
	arr[2] = new int[3];

	System.out.println(arr[0]);
	System.out.println(arr[1]);
	System.out.println(arr[2]);
	System.out.println(arr[0][2]);

	arr[1] = new int[2];
	display(arr);
}

public static void display(int[][] arr) {
	for (int i = 0; i <arr.length; i++)
	{
		for (int j = 0; j <arr.length; j++) {
			System.out.print(arr[i][j]+" ");
		}
		System.out.println();
	}	
}

}