int ia[] = new int[3];
//alternative array syntax. The previous one is recommended
ia[0] = 1; ia[1] = 2; ia[2] = 3;
int[] ia = { 1, 2, 3}; //initialization using an initializier list. Number of items provides the size. // Only use at declaration.
float[][] mat = new float[4][4];
//2-dimentional array (matrix).
for (int y = 0; y < mat.length; y++)
{
for (int x = 0; x <
mat[y].length; x++)
mat[y][x] = 0.0;
}
String[] words = new String[25]; // words is an array of references to String objects
C:\Courses\CSC224\Examples>java CommandLineArguments Hello
World!
args.length=2
args[0]=Hello
args[1]=World!