Is hashCode() return the actual address ?
807603Dec 17 2007 — edited Dec 18 2007String str1 = new String("abc");
String str2 = new String("abc");
System.out.println(str1==str2); // it will print 'false' as references of str1 and str2 are different
System.out.println(str1.hashCode()==str2.hashCode()); // it will print 'true'
If hashCode( ) return integer value of the address(or reference) of an object then how str1 and str2 are same ? As I know 'new' always return a new memory reference for an object. So what hashCode() return ?