Possible Duplicate:
Sorting a collection of objects
How to sort the list in java
List<Integer> list = new ArrayList<Integer>();
list.add(13);
list.add(8);
list.add(6);
list.add(4);
list.add(3);
i want to sort the list. Please help me to solve this.
just use:
if you want to sort in reverse order you have to implement the Comparator interface
and in your code use: