50,530
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) throws InterruptedException {
String a = "a";
String d = "demo";
String e = "abc";
int aHashcode = a.hashCode();
int dHashcode = d.hashCode();
int eHashcode = e.hashCode();
System.out.println(aHashcode ^ (aHashcode >>> 16)); //输出97
System.out.println(dHashcode ^ (dHashcode >>> 16));//输出3079629
System.out.println(eHashcode ^ (eHashcode >>> 16));//输出96355
}