Example 2: multidimensional array

import java.util.Arrays;

public class MultidimensionalArrayExample {
	public static void main(String[] args) {
		int[][] myArray = { { 0, 1 }, { 0, 1, 2, 3 }, { 0, 1, 2, 3, 4 } };

		for (int i = 0; i < myArray.length; i++) {
			for (int j = 0; j < myArray[i].length; j++) {
				System.out.print(myArray[i][j]);
			}
			System.out.println();
		}
	}
}
Output
01
0123
01234