I have a List of Objects like List.I want to sort this list alphabetically using Object name field. Object contains 10 field and name field is o
Have a look at Collections.sort() and the Comparator interface.
String comparison can be done with object1.getName().compareTo(object2.getName()) or object2.getName().compareTo(object1.getName()) (depending on the sort direction you desire).
If you want the sort to be case agnostic, do object1.getName().toUpperCase().compareTo(object2.getName().toUpperCase()).