I want to call the Object hashCode Object method through a String object. How to do it?

public class Test { public static void main(String args[]) { String s1 = "abc"; //Here is invoking of overriding String hashCode method. System.out.println("hashCode value "+s1.hashCode()); } } 

Instead, I want to get a non-intercepting hashCode method of an object. How to get it?

+7
source share
1 answer

call System.identityHashCode(s1) .

+12
source

All Articles