Answer:
array: a[21], b[34] etc.
ArrayList: arr.get(12), arr.get(23)
Explanation:
Remember that array is a fixed size collection of values of the same datatypes. We need to provide the array size at the time of the declaration itself. Like:
Student[]=new Student[5];
The above is an array of five student object types.
Similarly, we can have:
a[] =new int[5];
This is an array of five int type.
And we can output the fourth student as Student[4].name, Student[4].marks. And in int case like a[3], a[4], etc.
Similarly, we can get the value from ArrayList as:
arr.get(3);
ArrayList is a resizable array, and can be found inside java.util.ArrayList.