Next: Declaration of array variables
Up: Unit 07
Previous: Summary
An array object (or simply array) contains a collection of
elements of the same type, each of which is indexed (i.e., identified) by a
number. A variable of type array contains a reference to an array
object.
To use an array in Java we have to:
- declare a variable of type array that allows us to refer to an array
object;
- construct the array object specifying its dimension (number of elements
of the array object);
- access the elements of the array object through the array variable in
order to assign or obtain their values (as if they were single variables).
Next: Declaration of array variables
Up: Unit 07
Previous: Summary