![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java collection
ForKing_
这个作者很懒,什么都没留下…
展开
-
java Set and List part1
The Set InterfaceA Set is a Collection that cannot contain duplicate elements. It models the mathematical set abstraction. The Set interface containsonly methods inherited from Collection and原创 2013-09-21 19:59:40 · 585 阅读 · 0 评论 -
java set and list part2
容器类对象在调用remove contatins 等方法时需要比较对象是否相等,这会涉及到对象类型的equals 方法 和hashCode 方法;对于自定义的类型需要重写equals 和hashcode 方法以实现自定义对象相等 规则。相等的对象应该具有相等的hash codespackage com.wsx;import java.util.*;public class Te原创 2013-09-21 20:22:25 · 573 阅读 · 0 评论