I'm new to the concept of arraylist. I've made a short program that is as follows:
ArrayList<int[]> arl=new ArrayList<int[]>();
int a1[]={1,2,3};
arl.add(0,a1);
System.out.println("Arraylist contains:"+arl.get(0));
It gives the output: Arraylist contains:[I@3e25a5
Now my questions are:
- How to display the correct value i.e. 1 2 3.
- How can I access the single element of array a1 i.e. if I want to know the value at a1[1].