I am having an Arraylist of Objects. Those object have an attribute or datatype - \'String\'. I need to sort the Arraylist by that string. How to achieve this?
You need to write a ComparatorList
.
Or else, your MyObject
can also implements Comparable
On sorting List
on various criteria:
On Comparator
and Comparable