coderz.py

Keep Coding Keep Cheering!

Comparator Interface in Java Collection Framework

To sort the objects of user-defined classes, a comparator interface is utilized. A comparator object can compare two items of the same type.This interface may be found in java.util package and includes two methods: compare(Object obj1,Object obj2) equals (Object element). It supports different sorting sequences, which means you can sort the items based on any […]

August 6, 2022 | Java | No comments

Advertisement