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 optimized for basic learning, practice and more. Examples are well checked and working examples available on this website but we can't give assurity for 100% correctness of all the content. This site under copyright content belongs to Onlinetpoint. You agree to have read and accepted our terms of use, cookie and privacy policy.