+ 5
What is arrays??
3 Answers
+ 3
an array is a data structure that contains groups of element of similar data types
+ 2
in java an array is like a collection of variables of the same type which are all accessed by one variable name and an index, like this:
//declaration of an int array of length 5 (5 ints can be saved)
int[] arr = new int[5];
//setting value of index 0 (start)
arr[0] = 1;
//getting an value from the array
System.out.println(arr[0]);
//getting the length of the array
System.out.println(arr.length);
//can be used in for-loops
+ 1
a collection of datas.