
java collection
ForKing_
这个作者很懒,什么都没留下…
展开
-
java Set and List part1
The Set Interface A 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 · 615 阅读 · 0 评论 -
java set and list part2
容器类对象在调用remove contatins 等方法时需要比较对象是否相等,这会涉及到对象类型的equals 方法 和 hashCode 方法;对于自定义的类型需要重写equals 和hashcode 方法以实现自定义对象相等 规则。 相等的对象应该具有相等的hash codes package com.wsx; import java.util.*; public class Te原创 2013-09-21 20:22:25 · 593 阅读 · 0 评论