1.HashSet底层使用HashMap实现的
当使用add方法将对象添加到Set当中时,实际上是将该对象作为底层所维护的Map对象的key,而value都是同一个Object对象(该对象对我们用)
2.HashSet的iterator()方法:
3.HashMap的底层实现:
负载因子:load_factor
default_initial_capacity
4.HashMap底层会维护一个数组,我们向HashMap中所放置的对象实际上是存储在该数组当中.
5.当我们向HashMap中put一对键值时,它会根据key的hashcode值计算出一个位置,该位置就是此对象准备往数组中放置的位置.
6.如果该位置没有对象存在,就讲此对象直接放进数组当中;如果该位置已经有对象存在了,则顺着此存在的对象的链开始寻找(Entry类有一个Entry类型的next成员变量,指向了该对象的下一个对象).如果对此链上有对象的话,在去使用equals方法进行比较,如果对此链上的某个对象的equals方法比较为false,则将该对象放到数组当中,然后将数组中该位置以前存在的那个对象链接到对象的后面.
7.HashMap的内存实现布局:
8.
Vector:
用法和Arraylist相同,因为其实现了List接口.
9.HashTable:和HashMap类似.
10.Properties类常用作配置文件.
11.Jdk5.0中新特性介绍:
泛型:(Generics):只要编译时没有问题,执行时没有问题
12.所谓泛型:就是变量类型的参数化.