posted 15 years ago
public static <T extends Comparable<? super T>> void sort(List<T> list)
It means We are dealaring a method that will sort a list
of the type that must extend the Comparable Interface,and it msut provide it's base class as a type when impelemnting Comaprable
For ex
Class Person{}
Class Employee extends Comprabale(Person)
{
public int compareTo(Person o)
{
}
}
List<Employee> lis= new ArrayList<Employee>();
now this list is valid argumnet for the sort method.