Java: 集合类
Set
1 | public interface Set<E> extends Collection<E> |
JDK 提供 Set 接口 3 个实用类
HashSet,采用 Hash, 无固定顺序
TreeSet,实现 SortedSet 接口,有序
LinkedHashSet,有固定顺序
List
1 | public interface List<E> extends Collection<E>{ |
JDK 提供 Set 接口 3 个实用类
ArrayList, 效率最高
LinkedList, 还提供在结尾和开头 get,remove,insert
Vector
Queue
1 | public interface Queue<E> extends Collection<E> { |
Map
1 | public interface Map<K, V> { |