HashMap(类)
"Hash算法原理,针对键
put(key, value);
containsKey(key);
containsValue(value);
hm.keySet();所有键的集合
values();所有值的集合
hm.get(key);根据键获取值
void clear()
remove(Object key)
Set s = entrySet();
int size();键值对数
LinkedHashMap(类)
可保证存取顺序一致
TreeMap(类)
"二叉树原理,针对键
new Comparator<Student>()public int compare
(Student s1, Student s2)
s1.getName().compareTo(s2.getName());
}
HashMap嵌套HashMap:
hm.keySet()
get(h) //双for遍历
h.keySet()
h.get(key)" |
|