I have read articles about object identity in object oriented context.Which says "Every object you create has its own unique identity". But I got confused by below code.
String str="Hello";
String str1="Hello";
System.out.println(str.hashCode()); //69609650
System.out.println(str1.hashCode()); //69609650
System.out.println(System.identityHashCode(str));//19313225
System.out.println(System.identityHashCode(str1));//19313225
hash code and identityhashcode for both str and str1 are same. Please correct me if I understood wrong.
Also what is difference between hashcode() and system.identityhashcode()