Site hosted by Angelfire.com: Build your free website today!
 

Declaration

  • An array is a collection of items all having the same type.

  • In Java, an array is an object.

int[] myIntArray = new int[10];
...
myIntArray[5] = 100;
  • myIntArray is an int[], an integer array

  • new int[10] constructs an integer array with 10 elements, new returns a reference to the object that is being created.

  • therefore myIntArray contains a reference to an array object of 10 integers.