Alex Rivera | Logout

Why does Comparator declare equals?

Asked 2012-06-13T11:25:20.447
27

The Comparator interface has its own equals() method. Any class will get equals() by default through Object class. What is the need to have equals() method inside an interface?

Edit
Report

1 Answer

0

Putting an Object method in an interface declaration allows Javadoc declaration of the meaning equals is required to have in classes that implement the interface.

answered 2012-06-13T11:32:20.503

Your Answer