Jenkov.com
Tutorials Books About
Java Collections

1 Java Collections Tutorial
2 Java Collections - Overview
3 Java Collections - Iterable
4 Java Collections - Collection
5 Java Collections - Generic Collections
6 Java Collections - List
7 Java Collections - Set
8 Java Collections - SortedSet
9 Java Collections - NavigableSet
10 Java Collections - Map
11 Java Collections - SortedMap
12 Java Collections - NavigableMap
13 Java Collections - Queue
14 Java Collections - Deque
15 Java Collections - Stack
16 Java Collections - hashCode() and equals()
17 Java Collections - Sorting
18 Java Collections - Streams




Java Collections Tutorial


The Java Collections API's provide Java developers with a set of classes and interfaces that makes it easier to handle collections of objects. In a sense Collection's works a bit like arrays, except their size can change dynamically, and they have more advanced behaviour than arrays.

Rather than having to write your own collection classes, Java provides these ready-to-use collection classes for you. This tutorial will look closer at the Java Collection's, as they are also sometimes referred to, and more specifically the Java Collections available in Java 6.

The purpose of this tutorial is to give you an overview of the Java Collection classes. Thus it will not describe each and every little detail of the Java Collection classes. But, once you have an overview of what is there, it is much easier to read the rest in the JavaDoc's afterwards.

Most of the Java collections are located in the java.util package. Java also has a set of concurrent collections in the java.util.concurrent package. This tutorial will not describe the concurrent collections. These will be described in their own tutorial some time in the future.

Overview of Java Collections

To help you get an overview of the Java Collections classes and interfaces, the first text in this Java Collections tutorial is the Overview of Interfaces text.

The Central Java Collection Interfaces

The third and fourth text explains the two central interfaces: java.util.Collection and java.util.Iterable. Additionally, the java.util.Map is central too.

Java Collections and Generics

The fifth text in this Java Collections tutorial covers how to use Generics in Java Collections. Generics is very useful when working with Java's Collection classes.

Java Collections and the equals() and hashCode() Methods

The last two texts in this Java Collections tutorial explains the central role the two java.lang.Object methods equals() and hashCode() play when using Java Collections. You should read this, if you plan to use Java Collections with your own classes, and thus need to implement equals() and hashCode().



Connect with me: Newsletter - Get all my free tips!