Java Collections Framework


The Java Collections Framework (JCF) serves as a comprehensive architecture designed for the storage retrieval and manipulation of object groups.


The framework comprises interfaces and class implementations along with algorithms that enable efficient data management.


notepad

Java's standard library contains this component which resides in the java.util package.

java-collections

Key Interfaces

Interface Description
Collection Root of the collection hierarchy
List Ordered collection (allows duplicates)
Set Unordered, unique elements
Queue Elements processed in FIFO order
Map Key-value pairs, no duplicate keys

Collections Implementations

List Implementations

Class Description
ArrayList Resizable array
LinkedList Doubly-linked list
Vector Synchronized version of ArrayList
Stack LIFO structure based on Vector

Set Implementations

Class Description
HashSet No duplicates, unordered
LinkedHashSet Maintains insertion order
TreeSet Sorted set

Queue Implementations

Class Description
PriorityQueue Ordered by priority
ArrayDeque Double-ended queue

Map Implementations

Class Description
HashMap Key-value pair, no order
LinkedHashMap Maintains insertion order
TreeMap Sorted map by keys
Hashtable Legacy, thread-safe

Differences Between Major Interfaces

Feature List Set Map
Duplicates Allowed Not allowed Keys not allowed
Ordering Maintains order No order (except LinkedHashSet/TreeSet) Depends on implementation
Index-based access Yes No No



OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.