int[] a = new int[100];
The array entries are numbered from 0 to 99 (and not 1 to 100). Once the array is created, you can fill the entries in an array, for example, by using a loop:
int[] a = new int[100];
for (int i = 0; i < 100; i++)
a[i] = i; // fills the array with 0 to 99
No comments:
Post a Comment