title: Is it possible to implement comparator in single class?
body: <p>Generally I saw- To implement comparator in java collections we need 2 classes , one class call the sort function and 2nd class implement comparator.. I want to know Is there any way to implement whole comparator concept in a single class??</p>