Why does Comparator declare equals?

后端 未结 8 1554
无人及你
无人及你 2021-02-05 04:34

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

8条回答
  •  旧巷少年郎
    2021-02-05 04:53

    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.

提交回复
热议问题