I have created a array of ArrayList
but now I want to access its elements and sort them and print them, please help me to find out a way
ArrayList<Integer>[] lists = (ArrayList<Integer>[])new ArrayList[20] ;
for(int i=0;i<20;i++){
lists[i]=new ArrayList<Integer>();
lists[i].add(i+i*2);
lists[i].add(i+i*3);
lists[i].add(i+i*4);
lists[i].add(i+i*5);
}
System.out.println(lists);
output:-
[Ljava.util.ArrayList;@15db9742