static class MyClassComparator implements Comparator<MyClass>
{
public int compare(MyClass c1, MyClass c2)
{
return c1.getXXXXX().compareTo(c2.getXXXXX());
}
}
And then use
Collections.sort(list,new MyClassComparator());
No comments:
Post a Comment