How can Comparator be a Functional Interface when it has two abstract methods? [duplicate]

The docs also state:

If an interface declares an abstract method overriding one of the public methods of java.lang.Object, that also does not count toward the interface’s abstract method count since any implementation of the interface will have an implementation from java.lang.Object or elsewhere.

And since equals is one of those methods, the “abstract method count” of the interface is still 1.

Leave a Comment