为什么多次调用同一个对象的HashCode方法返回不一样

来源:互联网 发布:拍照解题的软件 编辑:程序博客网 时间:2024/05/18 00:59
public class HashCodeDemo 
{
public static void main(String[] args) 
{
Person p = new Person();
System.out.println(p.hashCode());
Person p2 = p;
System.out.println(p2.hashCode());
String str = "abc";
System.out.println(str.hashCode());
}
}




class Person
{
}
阅读全文
0 0
原创粉丝点击