为什么o对象的hashcode值变了?此对象不是没有进行任何操作吗?程序1:public class Temp { public static void main(String[] args) { Object o = new Object(); int[] a = new int[5]; // System.out.println("a hashcode:"+a.hashCode()); System.out.println("o hashcode:" + o.hashCode()); }}输出结果:o hashcode:366712642程序2:public class Temp { public static void main(String[] args) { Object o = new Object(); int[] a = new int[5]; System.out.println("a hashcode:"+a.hashCode()); System.out.println("o hashcode:" + o.hashCode()); }}输出结果:a hashcode:366712642o hashcode:1829164700重复问题:为什么o对象的hashcode值变了?此对象不是没有进行任何操作吗?
添加回答
举报
0/150
提交
取消