Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8335004

Mistake in the Comparator interface documentation

XMLWordPrintable

      ADDITIONAL SYSTEM INFORMATION :
      java 11 API documentation

      A DESCRIPTION OF THE PROBLEM :
      The problem is with the java.util.Comparator interface. As we know the Comparator interface is called the functional interface which also means these are the interfaces with exactly one abstract method, But in the Comparator documentation, in the method summary section, in abstract method section there are 2 methods listed, one is equals() and other is compare(). In both of them compare() is the abstract method, in case if any class implements this Comparator then it has a force contract to override the compare() only, not the equals()


            smarks Stuart Marks
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: