Java 18-Collection Final
Java 18-Collection Final
Java 18-Collection Final
Implementing an ArrayList
Implementing a TreeSet
Implementing a HashMap
Implementing a Deque
Ordering collections
Introduction
A collection is simply an object that groups multiple
elements into a single unit.
ArrayList
LinkedList
Vector
Stack
ArrayList
ArrayList
The ArrayList class extends AbstractList and
implements the List interface.
The hash code of a set is the sum of the hash codes of all the
elements in the set.
Keys are like indexes in List but in Map, the keys can be any
objects.
ArrayDeque(int numElements) : Constructs an
empty array deque with an initial capacity sufficient to
hold the specified number of elements.