Top Categories

14.8 Collection and Generics Part 5 in Java with Comparable Interface
  • Category:
  • Sub Category:
  • Generic Programming (Programming Language Paradigm)
  • part
  • comparable
  • interface
  • 5 java
  • Java (Programming Language)
  • compareto
  • collection
  • Java
  • Collections
No Views

In comparator interface we have compare() and comparable compareTo(). If you are going with custom class then it its preferable to go with comparable interface. And if it is in-build class then we can use comparator. 

Comments

You Might Be Interested In