Map interface
Inheritance diagram:
Map Common methods Add, delete operations
Object put(Object key, Object value)
Object remove(Object key)
void putAll(Map m)
void clear
Ways to manipulate meta views
Set keySet()
Collection values()
Set entrySet()
Element query operation
Object get(Object key)
boolean containsKey(Object key)
boolean containsValue(Object value)
int size()
boolean isEmpty()
boolean equals(Object obj)
HashMap
- HashMap is the most frequently used implementation class for map
- Null key and Null value are allowed, and the order of key is not guaranteed as HashSet
Linkedhashmap
- Linkedhashmap is a subclass of HashMap
- Similar to Linkedhashset to ensure that the traversal order is the same as the insertion Order
TreeMap
- Guaranteed key in a certain order
- Natural sort
- Custom sorting
Reference treeset;http://blog.csdn.net/ttf1993/article/details/45647775
Hashtable
Old class, Thread-safe
ProPerties
Properties File: Store some settings, or data
new Properties();//实例化一个对象pro.load(new FileInputStream("jdbc.properties"));//加载属性文件String user = pro.getProperty("user");//得到属性值
"Java Summary-collection" Map interface, HASHMAP, etc.