Hi Everyone,
I am searching the most effective way of sorting a list of objects.
Say i have a bean
public class MyClass {
private string name;
private string id;
// Getters and setters
}
Now say we put some values in a List
List<MyClass> myClassList = new ArrayList<MyClass>();
MyClass myClass = new MyClass();
//In some iterator adding items to the list
myClass.setName("John");
myClass.setId("100");
myClassList.add(myClass);
myClass.setName("Arnold");
myClass.setId("101");
myClassList.add(myClass);
// Say now my list has two entries of myClass object.
Now how do i sort myClassList based on Name.