Implementations are the data objects used to store collections, which implement the interfaces described in theInterfaces lesson.
The Java Collections Framework provides several general-purpose implementations of the core interfaces:
- For the
Setinterface,HashSetis the most commonly used implementation. - For the
Listinterface,ArrayListis the most commonly used implementation. - For the
Mapinterface,HashMapis the most commonly used implementation. - For the
Queueinterface,LinkedListis the most commonly used implementation. - For the
Dequeinterface,ArrayDequeis the most commonly used implementation.
Each of the general-purpose implementations provides all optional operations contained in its interface.
The Java Collections Framework also provides several special-purpose implementations for situations that require nonstandard performance, usage restrictions, or other unusual behavior.
The java.util.concurrent package contains several collections implementations, which are thread-safe but not governed by a single exclusion lock.
The Collections class (as opposed to the Collection interface), provides static methods that operate on or return collections, which are known as Wrapper implementations.
Finally, there are several Convenience implementations, which can be more efficient than general-purpose implementations when you don't need their full power. The Convenience implementations are made available through static factory methods.
Java集合框架实现
本文介绍了Java集合框架中常用的实现方式,包括Set接口的HashSet实现、List接口的ArrayList实现、Map接口的HashMap实现、Queue接口的LinkedList实现以及Deque接口的ArrayDeque实现。此外还探讨了特殊用途的实现以及并发集合。
7

被折叠的 条评论
为什么被折叠?



