Intro to Multi-dimensional Arrays
Outline
Return PA5, exam
Preview PA6
Review from the exam
Go over answers 1, 2, 6 (brief), 7(brief) , 8 (brief), 9
Questions about 3, 4, 5?
Multi-dimensional arrays.
Basics of multi-dimensional arrays
Row, column
Length
Multi-dimensional arrays are arrays of arrays of ??
Multi-dimensional arrays
Examples:
CorpSales.java
- Demonstrates creating and filling a two dimensional array with primitive values and then totalling all elements.
Lengths.java
- Demonstrates the use of the length attribute and initializer lists with two dimensional arrays.
MonthsDays.java
- Demonstrates the array of array nature of multidimensional arrays. The "rows" don't have to be of the same length.
Ragged Array
- An array of arrays in which the rows are of different sizes.
CS 239 - Spring 2011
Department of Computer Science
Nancy Harris Home Page
Current Classes Link