Hi all ,
I'm studying Collections for
SCJP .I have a doubt in Comparator interface .
While looking at the API I found that it contains two methods :
1.compare
2.equals
Here's where I'm stuck . while using Comparator mostly we are advised to (and most of the time only )override compare method but being a method in interface why we are not forced to override equals method ?
How it compiles successfully without overriding one method of interface ?
I also found it's because of equals method overrides from Object's class(if I understood correctly from API documentation )
what I understood is correct ?
It even confused me more .
How a interface extends a class(Object) ? (will it ?)
How a interface give implementation for a method ?
Please clarify my doubts .
Thanks in advance