What do you know about equals() and hashCode() methods?
2017-09-26
Inevitable, during a Java interview you will be asked about equals() and hashCode() methods which are declared in the java.lang.Object class. equals() method The equals method is declared as
|
1 2 3 |
public boolean equals(Object obj) { return (this == obj); } |
and indicates wether two objects are equals or not. It returns true in case the two objects are equals, andContinue Reading
