Answer:
Hi!
To create an array:
type[] varname OR type varname[]
where:
- type is the class of the array.
- var-name is the name of the variable.
- [] indicates that the instance would be an array.
Examples:
float floatArray[];
boolean[] booleanArray;
String[] stringArray;
Object objectArray[];
To reference an array:
type varname1[];
type varname2[] = varname1;
where:
- After assign varname1 to varname2, varname2 points to the elements of varname1;
To address an element in an array:
type varname[n];
type i = varname[i];
If you want to access to the i element of the array you can do : varname[i];