java具有满足不同需要的各种类型的容器,List (用于储存序列)、Map(又叫关联数组,建立对象间的关联)、Set(每个对象类型只持有一个)。
具有不同容器的原因:
1)不同容器提供了不同的类型接口和外部行为。
2)不同的容器对于某些操作具有不同的效率。
如:ArrayList和LinkedList
ArrayList查找快
LinkedList插入快
向下转型和向上转型