摘要: 向数组里 put 元素,必然需要知道数组的引用名称和要被 put 的位置的下标, HashMap 的 put 方法只有 key 和 value 两个参数,没有 int 类型的 index,那 HashMap 是如何确定每个元素会被存放到数组的哪个位置呢? 如何确定位置 这里需要提到indexFor方 阅读全文
posted @ 2022-07-28 09:50 qwdsa019X 阅读(405) 评论(0) 推荐(0) 编辑
摘要: //继承了AbstractSet类,实现了Set等接口public class HashSet<E> extends AbstractSet<E> implements Set<E>, Cloneable, java.io.Serializable 成员方法 private transient Ha 阅读全文
posted @ 2022-07-28 09:48 qwdsa019X 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 在new Vector()时,相当于调用有参构造,默认传入容量为10 阅读全文
posted @ 2022-07-21 11:45 qwdsa019X 阅读(40) 评论(0) 推荐(0) 编辑
摘要: ArrayList继承了abstractList类,实现了List接口,可以看出ArrayList的本质是数组 成员变量: 1:private static final long serialVersionUID = 8683452581122892189L;// serialVersionUID 阅读全文
posted @ 2022-07-21 11:34 qwdsa019X 阅读(28) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示