Class GJRN
Class GJRN
The Java Collection Framework provides a set of classes and interfaces that implement commonly
reusable collection data structures. Collections are used to store, retrieve, manipulate, and
- ArrayList Class
- LinkedList Class
- Vector Class
- Stack Class
- HashSet Class
- LinkedHashSet Class
- SortedSet Interface
- TreeSet Class
- PriorityQueue Class
- Deque Interface
Java Collection Framework Overview
- ArrayDeque Class
- HashMap Class
- LinkedHashMap Class
- SortedMap Interface
- TreeMap Class
- Hashtable Class
Iterator Interface
The Iterator interface provides methods to iterate over any Collection. It has three main methods:
Set Interface
The Set interface extends the Collection interface and represents a collection that does not contain
- HashSet
- LinkedHashSet
- TreeSet
Java Collection Framework Overview
HashSet
HashSet is an implementation of the Set interface backed by a hash table. It does not guarantee
- It provides constant-time performance for basic operations like add, remove, contains, and size.
LinkedHashSet
LinkedHashSet is a subclass of HashSet and implements the Set interface. It maintains a linked list
of the entries in the set, in the order in which they were inserted.
SortedSet Interface
The SortedSet interface extends the Set interface and provides a total ordering on its elements.
TreeSet
- It guarantees that the elements will be in ascending order, according to their natural order or by a
Java Collection Framework Overview
specified comparator.
Map Interface
The Map interface maps unique keys to values. A map cannot contain duplicate keys, and each key
- HashMap
- LinkedHashMap
- TreeMap
- Hashtable
HashMap Class
HashMap is an implementation of the Map interface backed by a hash table. It allows null values
- It provides constant-time performance for basic operations like get and put.
LinkedHashMap Class
LinkedHashMap extends HashMap and maintains a doubly-linked list running through all of its
entries. This linked list defines the iteration ordering, which is normally the order in which keys were
TreeMap Class
on a Red-Black tree.
Hashtable Class
Hashtable is a legacy class that implements the Map interface. It is synchronized and does not allow
- It is generally considered obsolete in favor of the more modern HashMap class, unless thread-safe
behavior is required.