摘要: HashTable继承于比较古老的Dictionary,而HashMap是接口Map的实现。 HashMap是HashTable的一个轻量级实现,HashMap不是线程安全的,而HashTable是线程安全的。 HashMap允许key或者value为null,而HashTable是不允许的。 在效 阅读全文
posted @ 2017-05-21 15:50 跳跃的弗里德里克 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Map集合的基本应用: Map<Integer,Student> map=new HashMap<Integer,Student>(); map.put(1, new Student(1,"张三","男",23)); map.put(2, new Student(2,"里斯","女",21)); m 阅读全文
posted @ 2017-05-21 14:53 跳跃的弗里德里克 阅读(143) 评论(0) 推荐(0) 编辑