READING CHAPTER 10 SECTION 5 "Two-Dimensional Arrays" - table organized in columns - effective means for communicating many types of information - represented in Java with *two-dimensional arrays* - so far, only one dimensional arrays - only one index - declare a 2D array [][] ; [][]; - create a 2D array = new [][]; - 2D array requires 2 indexes - one to specify the row - one to specify the column - accessing an element of a 2D array - specify the row and column numbers as indexes - accessing the length for each dimension - accessing the number of rows .length - accessing the number of columns [].length - no explicit 2D array structure in Java - faking it by using an array of arrays - shorthand for - manually creating an array - manually creating a new array for each element of the first array - subarray: array that is part of another array - don't all have to be the same length - initialize an array of arrays at the time of declaration - nest the curly brace syntax - no limit to the number of dimensions an array can have - arrays with dimensions greater than 2 rarely used in OO programming Quick Check 1. int sum = 0, numElements = 0; for (int i = 0; i < payScaleTable.length; i++) { numElements += payScaleTable[i].length; for (int j = 0; j < payScaleTable[i].length; j++) { sum += payScaleTable[i][j]; } } double average = (double) sum / numElements; 2. int biggest = table[0][0]; for (int i = 0; i < table.length; i++) { for (int j = 0; j < table[i].length; j++) { if (table[i][j] > biggest) { biggest = table[i][j]; } } } 3. 10 5