Mega Code Archive

 
Categories / Java Book / 005 Collection
 

0340 Get comparator in reverse order

static<T> Comparator<T> reverseOrder() Returns a comparator that imposes the reverse of the natural ordering on a collection of objects that implement the Comparable interface. static<T> Comparator<T> reverseOrder(Comparator<T> cmp) Returns a comparator that imposes the reverse ordering of the specified comparator.