Java 我想通过String对象调用Object hashCode方法。怎么做?
取而代之的是,我希望得到非重写对象hashCode方法。如何获取它?请调用Java 我想通过String对象调用Object hashCode方法。怎么做?,java,string,object,hashcode,overriding,Java,String,Object,Hashcode,Overriding,取而代之的是,我希望得到非重写对象hashCode方法。如何获取它?请调用System.identityHashCode(s1) public class Test { public static void main(String args[]) { String s1 = "abc"; //Here is invoking of overriding String hashCode method. System.out.println("
System.identityHashCode(s1)
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()); }
}