12,600 results
Open links in new tab
  1. Comparator (Java Platform SE 8 ) - Oracle Help Center

    Comparators can also be used to control the order of certain data structures (such as sorted sets or sorted maps), or to provide an …

  2. Java Comparator Interface - GeeksforGeeks

    May 13, 2026 · The Comparator interface in Java is used to define custom sorting logic for objects. It belongs to java.util package …

  3. Comparator (Java Platform SE 8 ) - docs.oracle.com

    java.util.concurrent.locks java.util.function java.util.jar java.util.logging java.util.prefs java.util.regex java.util.spi java.util.stream …

  4. Java Advanced Sorting (Comparator and Comparable) - W3Schools

    An object that implements the Comparator interface is called a comparator. The Comparator interface allows you to create a class …

  5. Comparator and Comparable in Java - Baeldung

    Dec 1, 2017 · In this article, we explored the Comparable and Comparator interfaces, and discussed the differences between them. …

  6. Comparator Methods and Examples - GeeksforGeeks

    Jan 29, 2026 · The Comparator interface in Java is used to define custom sorting logic for objects. It allows sorting collections based …

  7. Java - How to Use Comparator? - Online Tutorials Library

    obj1 and obj2 are the objects to be compared. This method returns zero if the objects are equal. It returns a positive value if obj1 is …

  8. Guide to Java Comparator.comparing () - Baeldung

    Jan 8, 2024 · A detailed explanation of lambdas and Comparator can be found here, and a chronicle on the applications of …

  9. Java Comparator Interface: comparing(), thenComparing(), nulls

    Oct 17, 2026 · The Comparator interface in Java defines a sort order outside the class being sorted, through one method, compare …

  10. Comparator Java Example - Java Code Geeks

    Jul 15, 2014 · Interested to learn more about Comparator Java? Then check out our detailed Comparator Java example, an interface …