dhust
8/3/2013 - 12:44 AM

arrayOfIntegers.java

/***** Declaring an array with a set size. The array is automatically filled with zeros. *****/
int[] myList = new int[10];
// prints the first element of the array, since it's [0]
System.out.println( myList[0] );

/***** Declaring & initializing the array with zeros *****/
int[] myList = { 0,0,0,0,0,0,0,0,0,0 };
// prints the first element of the array
System.out.println(myList[0]);

// OUTPUT:
// 0