本帖最后由 mohuancaizi 于 2014-4-1 20:03 编辑
ArrayList al.add(new Person("lisi01", 30));
al.add(new Person("lisi02", 32));
al.add(new Person("lisi03", 33));
al.add(new Person("lisi03", 33));
同样的元素视为同意个人
HashSet中
hs.add(new Person("a2",12));
hs.add(new Person("a3",13));
hs.add(new Person("a4",14));
hs.add(new Person("a1",11));
hs.add(new Person("a1",11));
问题:HashSet 和Arraylisht 中 equals的区别在于 哪 ???
|
|