Q:

how to sort arraylist

//METHOD RETURNS VOID
Collections.sort(arrayList);
0
import Collections

ArrayList< int > a = new ArrayList();
a.add(1);
a.add(3);
a.add(2);
a.add(-3);

ArrayList< int > sorted = Collections.sort(a);
-2
Collections.sort(coll); -> helps sort an arraylist.
0

New to Communities?

Join the community