Using array elements
Suppose g is an array of integers
Then, g[i] where i is in range can be used just as an integer variable
- g[i] = 3; a = g[i]*2; c.setX(g[i]);
- System.out.println(“value is ” + g[i]);
Note that arrays are objects -- therefore have the same ‘call by value’ conventions
Java does bounds checking -- throws exception if out of bounds