[Go to site: main page, start]

0% found this document useful (0 votes)
7 views2 pages

Java Collections Framework Overview

The Java Collections Framework (JCF) provides a unified architecture for managing collections through various interfaces and classes. Key interfaces include Collection, List, Set, Queue, and Map, with major implementing classes like ArrayList, HashSet, and HashMap. The framework promotes code reusability, supports generics for type safety, and offers both thread-safe and non-thread-safe options.

Uploaded by

cglprep9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Java Collections Framework Overview

The Java Collections Framework (JCF) provides a unified architecture for managing collections through various interfaces and classes. Key interfaces include Collection, List, Set, Queue, and Map, with major implementing classes like ArrayList, HashSet, and HashMap. The framework promotes code reusability, supports generics for type safety, and offers both thread-safe and non-thread-safe options.

Uploaded by

cglprep9
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Collections Framework - Classes and

Interfaces Overview

The Java Collections Framework (JCF) is a unified architecture for representing and manipulating
collections. It includes interfaces, implementations (classes), and algorithms to manage groups of
objects.

Core Interfaces
Interface Description
Collection Root interface of the collection hierarchy. Defines basic methods like add(), remove(), siz
List Ordered collection (sequence) that allows duplicates. Implementations: ArrayList, LinkedL
Set Collection that does not allow duplicates. Implementations: HashSet, LinkedHashSet, Tre
Queue Collection used to hold multiple elements prior to processing (FIFO). Implementations: Pr
Deque Double-ended queue supporting element insertion/removal at both ends. Implementation
Map Object that maps keys to values, no duplicate keys allowed. Implementations: HashMap,
SortedSet Extends Set for sorted elements. Implementation: TreeSet.
SortedMap Extends Map for sorted key-value mappings. Implementation: TreeMap.
NavigableSet Extends SortedSet with navigation methods like lower(), higher().
NavigableMap Extends SortedMap with navigation methods like ceilingEntry(), floorEntry().

Major Implementing Classes


Class Implements Description
ArrayList List Resizable array implementation. Fast random access, slow insertion/rem
LinkedList List, Deque Doubly-linked list. Fast insertion/removal, slower random access.
Vector List Synchronized version of ArrayList (legacy).
Stack Vector Last-in-first-out (LIFO) stack operations.
HashSet Set Backed by HashMap, unordered, no duplicates.
LinkedHashSet Set Maintains insertion order, no duplicates.
TreeSet NavigableSet Sorted order using natural ordering or comparator.
PriorityQueue Queue Queue ordered by natural order or comparator (not FIFO).
ArrayDeque Deque Resizable array-based deque, faster than Stack for stack/queue operation
HashMap Map Stores key-value pairs, allows one null key, unordered.
LinkedHashMap Map Maintains insertion order of keys.
TreeMap NavigableMap Sorted map based on natural ordering or custom comparator.
Hashtable Map Synchronized legacy map, no null key or value allowed.
EnumSet Set High-performance Set for enum types only.
EnumMap Map High-performance Map for enum keys only.

Key Properties of Java Collections Framework:


• Provides standard interfaces and classes for storing and manipulating groups of data.
• Promotes code reusability and reduces programming effort.
• Supports generic types for type safety.
• Offers thread-safe and non-thread-safe variants.
• Includes utility classes like Collections and Arrays for common algorithms (sort, search, shuffle).

You might also like