Java Arrays

Java arrays fall between a primitive data type and an object

Properties of Java arrays:

byte buffer[];		// array declaration (buffer = null)
buffer = new byte[1024];	// array creation (contents initialised to zeros)
int table[] = new int[10];	// declaration and creation combined
   
int sqrs[] = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81 }; // with an initializer
buffer[5] = sqrs[sqrs.length-1]; // array references
   
int triangle[][] = new int[3][];	// 2D Arrays do not have to be matrix
triangle[0] = new int[3];
triangle[1] = new int[2];
triangle[2] = new int[1];