Lecture 23 Notes multidimensional arrays in Java --> array of arrays --> Why? --> arrays are objects, so why not make the objects arrays.... declaration: --> type[][].... each [] refers to a dimension assignment --> name = type[size1][size2]... but what about array of objects? + technically multidim array element is a reference to another object + the other object is an array ex) int[][] a = new int[2][3] means int[] a is first array of 2 elements that contain refs to 1-D arrays each of the 1-D arrays has 3 elements that can hold integers! (draw boxes here as column arrays) a 1st array 2nd arrays (draw in row major form) AOA0 Example! Ways to declare multidim arrays (because of aoa idea): int[][] x int[] x[] int x[][] Ragged arrays Can leave out "furthest" size when creating arrays: int[][] x = new int[2][] Why?!? draw boxes Row major vs col major