How to override hashcode() and equals() method in java
hashcode() and equals() : Overview hashcode() and equals() methods are defined in java.lang.Object class which is the super class of all classes in java and hence may be overridden in any class. The signature of hashcode() method is public int hashCode() which means it should return an integer, and The signature of equals() method looks like public boolean equals(Object obj) which means it returns a boolean value indicating whether the object which called it is equal to the object which is passed as an argument to it or not.Read More →