September 2005
Beginner
576 pages
13h 6m
English
The arrays you have been introduced to thus far in the hour all have one dimension, so you can retrieve an element using a number ranging from 0 to the largest element number in the array. Some types of information require more dimensions to store adequately as arrays. An example would be the (x,y) coordinate system. If you needed to store a list of x and y coordinates that have a point marked on them, you could use a two-dimensional array. One dimension of the array could store the x coordinate, and the other dimension could store the y coordinate.
To create an array that has two dimensions, you must use an additional set of square brackets when creating and using the array. Consider the following:
boolean[][] selectedPoint ...
Read now
Unlock full access