Collections Java Interview Questions – Set 03
What is the importance of hashCode() and equals() methods? How they are used in Java The java.lang.Object has two methods defined in it. They are – public boolean equals(Object obj) public int hashCode(). These two methods are used heavily when objects are stored in collections. There is a contract between these two methods which should … Read more