What is a comparator in Java?

54. What is a comparator in Java?

  1. Interface to compare integer
  2. Comparison method for lists
  3. Interface to compare two objects in java
  4. 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.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.