Contoh:
- array dua dimensi: int [ ] [ ] arr2;
- array tiga dimensi: int [ ] [ ] arr3;
- array empat dimensi: int [ ] [ ] arr4;
int [ ] [ ] arr2 = new int [2][3]; //artinya memory menampung nilai tipe data integer sebanyak 2 * 3 (dua baris, 3 kolom).
Contoh source code array 2 x 3, testArray2.php:
public class testArray2 { public static void main(String[] args) { int arr[][] = {{1, 2, 3}, {4, 5, 6}}; System.out.println("Panjang dimensi ke-1 = "+arr.length); System.out.println("Panjang dimensi ke-2 = "+arr[0].length); } }