Java Reference
In-Depth Information
figure 2-10
Your array now looks like this:
index
data stored
0
Jeremy
Then you add another element to the array, this time with an index of
1
:
myArray[1]
=
"Paul";
Your array now looks like this:
index
data stored
0
Jeremy
1
Paul
Finally, you add another element to the array with an index of
2
:
myArray[2]
=
"John";
Your array now looks like this:
index
data stored
0
Jeremy
1
Paul
2
John