Vector 和 ArrayList
Vector非常类似ArrayList,但是Vector是同步的.Vector它允许所有元素,包括null
ArrayList实现了可变大小的数组。它允许所有元素,包括null。
HashMap HashTable
HashTable与HashMap非常类似,除了HashTable是同步的和HashTable不允许null Object作为key或value值.
Hashtable是Dictionary的子类,HashMap是Map接口的一个实现类
HashSet TreeSet
Set是一种不包含重复的元素的Collection,即任意的两个元素e1和e2都有e1.equals(e2)=false,Set最多有一个null元素。 HashSet 允许null 值
TreeSet可对其插入的元素按自然顺序排序(Comparable or Comparator ),TreeSet不允许null值将抛出java.lang.NullPointerException.
java.util
Class ArrayList
java.lang.Object java.util.AbstractCollection java.util.AbstractList java.util.ArrayList
Resizable-array implementation of the List interface. Implements all optional list operations, and permits all elements, including null. In addition to implementing the List interface, this class provides methods to manipulate the size of the array that is used internally to store the list. (This class is roughly equivalent to Vector, except that it is unsynchronized.)
java.util
Class HashMap
java.lang.Object java.util.AbstractMap java.util.HashMappublic class HashMap extends AbstractMap implements Map, Cloneable, Serializable
Hash table based implementation of the Map interface. This implementation provides all of the optional map operations, and permits null values and the null key. (The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls.)