Skip to main content

Java Collection Programs

ArrayList, HashMap, HashSet, TreeMap, Queue and related collection APIs.

1
java collection programs

Linked List Example in Java

This class stores the elements in nodes that each have a pointer to the previous and next nodes in the list. A Java example with source code and sample output.

2
java collection programs

Arraylist Example in Java

The ArrayList class extends AbstractList and implements the List interface. A Java example with source code and sample output.

3
java collection programs

Hashset Example in Java

A set can't have any duplicate elements in it. A Java example with source code and sample output.

4
java collection programs

Clear an Arraylist Example in Java

An ArrayList is a non-syncronized class. A Java example with source code and sample output.

5
java collection programs

Reversing an Arraylist Example in Java

An ArrayList is a non-syncronized class. A Java example with source code and sample output.

6
java collection programs

Linked Hashset Example in Java

HashSet uses a hash table. A Java example with source code and sample output.

7
java collection programs

Hashmap Example in Java

A Hashmap is a Map data structure. A Java example with source code and sample output.

8
java collection programs

Set Value in Arraylist Example in Java

An ArrayList is a non-syncronized class. A Java example with source code and sample output.

9
java collection programs

Linked Hashmap Example in Java

HashMap uses a hash table. A Java example with source code and sample output.

10
java collection programs

Remove Element from Arraylist Example in Java

An ArrayList is a non-syncronized class. A Java example with source code and sample output.

11
java collection programs

Identity Hashmap Example in Java

Identity HashMap is a HashTable based implementation of Map Interface. A Java example with source code and sample output.

12
java collection programs

Treemap Example in Java

Maps are defined by the java.util.Map interface in Java. A Java example with source code and sample output.

13
java collection programs

Treeset Example in Java

TreeSet uses a red-black tree implemented by a java.util.TreeMap. A Java example with source code and sample output.

14
java collection programs

Finding Duplicates in Array using Treeset Example in Java

TreeSet uses a red-black tree implemented by a java.util.TreeMap. A Java example with source code and sample output.

15
java collection programs

Hashtable Example in Java

A hash table is a data structure used to implement an associative array, a structure that can map keys to values. A Java example with source code and sample output.

16
java collection programs

Enumset Example in Java

EnumSet inherits AbstractSet and implements Set Interface. A Java example with source code and sample output.

17
java collection programs

Enum Map Example in Java

EnumMap is a specialized Map implementation for use with enum type keys. A Java example with source code and sample output.

18
java collection programs

Wrapper Example in Java

Wrapper in Java: a complete example program with source code and sample output, explained step by step.

19
java collection programs

Un Modifiable Wrapper Example in Java

Un Modifiable Wrapper explained in Java, with a complete example program, its sample output, and a clear code walkthrough.

20
java collection programs

Iterator Interface Example in Java

A Java example program demonstrating Iterator Interface, complete with the source code and expected sample output.

21
java collection programs

Sorted Map Interface Example in Java

Sorted Map Interface defines a map that's sorted by the keys provided. A Java example with source code and sample output.

22
java collection programs

Sorted Set Interface Example in Java

Sorted Set Interface explained in Java, with a complete example program, its sample output, and a clear code walkthrough.

23
streams

Java Stream API Example in Java

Introduction to the Java Stream API with filter, map, sorted and collect operations on a list of integers and strings, with sample output.

Related Topics

Search tutorials