Consider the following code:
public class MyClass {
public static void main(String[] args) {
Object obj = new Object();
System.out.println(obj.hashCode());
System.out.println(System.identityHashCode(obj));
}
}
Output:
328332828
328332828
Then what is the use of using hashCode() and identityHashCode()?