int[] myArray = { 1, 2, 3 }which is nice and compact. Some books tell you to do:
int[] myArray = new int[] { 1, 2, 3 };which works but is more verbose. Initialize a 2D array in this way:
int[][] twoDimArray = { {1,2,3}, {4,5,6}, {7,8,9} };
int[] myArray = { 1, 2, 3 }which is nice and compact. Some books tell you to do:
int[] myArray = new int[] { 1, 2, 3 };which works but is more verbose. Initialize a 2D array in this way:
int[][] twoDimArray = { {1,2,3}, {4,5,6}, {7,8,9} };