Pages

Showing posts with label Sorting Objects. Show all posts
Showing posts with label Sorting Objects. Show all posts

Monday, January 10, 2011

Sorting the objects using collections

We can implement using two following ways:

Way 1:
Step 1:
the object which supposed to sort in collection needs to be implements Comparable interface
For Ex: Object TestPOJO needs to be sort so that class looks like below: