Java collection is a group of objects that are used to perform data manipulation operations such as storing, searching, sorting, inserting, deleting, and updating data. The Collection API is a collection of classes and interfaces that are more flexible, more powerful, and more consistent than vectors, arrays, and hash tables. The Collections Framework is a complex hierarchy of interfaces and classes for organizing and managing groups of objects.
The following section contains various programs related to the Collection interface and classes. Collection Interface covers programs on list interface, set interface, queue, and dequeue interfaces. It also covers various collection “class” programs on HashSet, HashMap, ArrayList, LinkedList, PriorityQueue, TreeSet, and TreeMap. Each sample program includes a program description, Java code, and program output. All examples have been compiled and tested on Windows and Linux systems.
Here is the listing of Java programming examples on Collections Framework:
- Java Collection Programs on List Interface
- Java Collection Programs on Queue Interface
- Java Collection Programs on Dequeue Interface
- Java Collection Programs on Set Interface
- Java Collection Programs on HashMap Interface
- Java Collection Programs on Map Interface
- Java Collection Programs on Legacy Classes and Interfaces
1. Java Collection Programs on List Interface
Program | Description |
---|---|
ArrayList API in Java | Java Program to Implement ArrayList API |
AttributeList API in Java | Java Program to Implement AttributeList API |
CopyOnWriteArrayList API in Java | Java Program to Implement CopyOnWriteArrayList API |
LinkedList API in Java | Java Program to Implement LinkedList API |
RoleList API in Java | Java Program to Implement RoleList API |
RoleUnresolvedList API in Java | Java Program to Implement RoleUnresolvedList API |
2. Java Collection Programs on Queue Interface
Program | Description |
---|---|
ArrayBlockingQueue API in Java | Java Program to Implement ArrayBlockingQueue API |
ConcurrentLinkedQueue API in Java | Java Program to Implement ConcurrentLinkedQueue API |
DelayQueue API in Java | Java Program to Implement DelayQueue API |
LinkedBlockingQueue API in Java | Java Program to Implement LinkedBlockingQueue API |
LinkedTransferQueue API in Java | Java Program to Implement LinkedTransferQueue API |
PriorityBlockingQueue API in Java | Java Program to Implement PriorityBlockingQueue API |
PriorityQueue API in Java | Java Program to Implement PriorityQueue API |
SynchronosQueue API in Java | Java Program to Implement SynchronosQueue API |
3. Java Collection Programs on Dequeue Interface
Program | Description |
---|---|
ArrayDeque API in Java | Java Program to Implement ArrayDeque API |
LinkedBlockingDeque API in Java | Java Program to Implement LinkedBlockingDeque API |
4. Java Collection Programs on Set Interface
Program | Description |
---|---|
CopyOnWriteArraySet API in Java | Java Program to Implement CopyOnWriteArraySet API |
HashSet API in Java | Java Program to Implement HashSet API |
LinkedHashSet API in Java | Java Program to Implement LinkedHashSet API |
TreeSet API in Java | Java Program to Implement TreeSet API |
5. Java Collection Programs on HashMap Interface
Program | Description |
---|---|
HashMap API in Java | Java Program to Implement HashMap API |
IdentityHashMap API in Java | Java Program to Implement IdentityHashMap API |
LinkedHashMap API in Java | Java Program to Implement LinkedHashMap API |
ConcurrentHashMap API in Java | Java Program to Implement ConcurrentHashMap API |
WeakHashMap API in Java | Java Program to Implement WeakHashMap API |
6. Java Collection Programs on Map Interface
Program | Description |
---|---|
EnumMap API in Java | Java Program to Implement EnumMap API |
ConcurrentSkipListMap API in Java | Java Program to Implement ConcurrentSkipListMap API |
TreeMap API in Java | Java Program to Implement TreeMap API |
SimpleBindings API in Java | Java Program to Implement SimpleBindings API |
RenderingHints API in Java | Java Program to Implement RenderingHints API |
7. Java Collection Programs on Legacy Classes and Interfaces
Program | Description |
---|---|
Attribute API in Java | Java Program to Implement Attribute API |
HashTable API in Java | Java Program to Implement HashTable API |
JobStateReasons API in Java | Java Program to Implement JobStateReasons API |
PrinterStateReasons API in Java | Java Program to Implement PrinterStateReasons API |
Stack API in Java | Java Program to Implement Stack API |
Vector API in Java | Java Program to Implement Vector API |