I understand why providing same hashcode for two equal (through equals) objects is important. But is the vice versa true as well, if two objects have same hash
equals
hashCode value depends on the implementation. for example String class implements hashCode() function depending upon the value. it means
hashCode
String
hashCode()
String a=new String("b"); String b=new String("b");
will have same hashcode but, these are two different objects. and a==b will return false.
hashcode
a==b
false