To use an array value, you give the name of the array and the position number within [ ], and use it like any other variable. |
int numbers [ ] = new int [ 7 ] ; |
numbers [0] = 5 ; |
numbers [1] = numbers [0] + 2 ; |
String labels [ ] = new String [ 64 ]; |
labels [ 0 ] = "The first string label"; |
g.drawString ( labels [ 0 ], 10, 20 ) ; |
Create the array |
Assign position 0 |
Use position 0 |