Home »
MCQs »
Java MCQs
What is a comparator in Java?
54. What is a comparator in Java?
- Interface to compare integer
- Comparison method for lists
- Interface to compare two objects in java
- All of these
Answer: C) Interface to compare two objects in java
Explanation:
Java Comparator interface is used to order the objects of a user-defined class.