August 6, 2010 at 5:37 PM
Comparator interface is used to sort a collection by custom sorting.
To sort the data elements a class needs to implement Comparator or Comparable interface.
For more information, visit the following links:
To access the element of a collections, there are two ways:
1.Use get(index) method of Collection object to get the element of the object.This method will return Object only.
2.Use Enumeration or Iterator object to get the object one by one.