Memory State Diagram of Arrays

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]

int a1[] = new int[6];
int a2[] = a1;

*An array that has 6 components can be indexed from 0 to 5.
 
*As arrays are objects, references are copied only (shallow copy) in case of an assignment.
 
*Note that all array components are automatically initialized by the new operator (to 0 in case of int).
 

 [Previous Chapter]  [Previous Page]  [Contents]  [Next Page]  [Next Chapter]
Copyright © 2001, 2002 Andreas Borchert, converted to HTML on February 11, 2002