Java tutorial
import java.lang.reflect.Array; public class MainClass { public static void main(String args[]) { int dimensions[] = { 3, 4 }; int array[][] = (int[][]) Array.newInstance(int.class, dimensions); for (int[] inner : array) { for (int i : inner) { System.out.println(i); } } } }