Java Collections Tutorial


This tutorial describes the Java Collections Framework. Here, you will learn what collections are and how they can make your job easier and programs better. You'll learn about the core elements — interfaces, implementations, aggregate operations, and algorithms — that comprise the Java Collections Framework.

The Java Collections Tutorial source code examples have been written using JDK 8 or later. Source code examples and practices described in this tutorial are well tested in our development environment.

YouTube Video - Java Collections Framework Course

What is a Collections Framework?

A collections framework is a unified architecture for representing and manipulating collections.
The collections framework consists of:
  • Collection interfaces - These interfaces represent different types of collections, such as SetList, and Map. These interfaces form the basis of the framework.
  • General-purpose implementations - These are primary implementations of the collection interfaces such as ArrayListLinkedListHashSetLinkedHashSetHashMap etc.
  • Legacy implementations - The collection classes from earlier releases, Vector and Hashtable, were retrofitted to implement the collection interfaces.
  • Special-purpose implementations - Implementations designed for use in special situations such as CopyOnWriteArrayListCopyOnWriteArraySetEnumSetEnumMapWeakHashMap and IdentityHashMap etc.
  • Concurrent implementations - These implementations designed for highly concurrent use such as ConcurrentSkipListSetConcurrentHashMapConcurrentSkipListMap etc.
  • Wrapper implementations - Add functionality, such as synchronization, to other implementations.
  • Convenience implementations - High-performance "mini-implementations" of the collection interfaces.
  • Abstract implementations - Partial implementations of the collection interfaces to facilitate custom implementations such as AbstractCollectionAbstractSetAbstractListAbstractSequentialList and AbstractMap.
  • Algorithms - Static methods that perform useful functions on collections, such as sorting a list.
  • Infrastructure - Interfaces that provide essential support for the collection interfaces.
  • Array Utilities - Utility functions for arrays of primitive types and reference objects. Not, strictly speaking, a part of the collections framework, this feature was added to the Java platform at the same time as the collections framework and relies on some of the same infrastructures.

Get Start with Interfaces

List Implementations

General-Purpose List Implementations:
General-Purpose Set Implementations:
Special-Purpose Set Implementations:

Map Implementations

General-purpose Map Implementations:

Aggregate Operations(Streams)

Collections Helper/Utility Classes

          - Sorting
          - Shuffling
          - Searching
          - Composition
          - Finding Extreme Values

Convert Collections Examples

Collections Examples

Collections Differences

YouTube Video Series - Java Collections Framework in Depth Series

Best Practices and Interviews

Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours


Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course