- If you want to declare and initialize a one-dimensional array, then
instantiate the following pattern:
data type array name [] =
new data type[number of elements];
- If you have an array, and you want to write a value into the array at
a specified position, then instantiate the following pattern:
array name[index] = expression;
- If you want to know whether an class-instance-containing array has been
assigned a value at a specified position, then instantiate the
following pattern:
array name[index] == null
- If you have a value stored in an array at a specified position, and
you want to read that value, then instantiate the following pattern:
array name[index]
- If you want to know the length of an array, then instantiate the
following pattern:
array name.length