Array
- If we need 3 integer variables, we type:
-
int i, j, k;
- If we need 1000 integer variables...?!
- we want to use an index to access variables of the same name (identifier) and type:
-
i[0] = 5;
i[654] = -378;
- How to do that?
-
int[] i = new int[1000];
- OR ( C++ style )
-
int i[] = new int[1000];
integer array type (a collection of integers) |
Facebook