Collections
https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html
Interface Collection, is the root interface in the collection hierarchy. A collection represents a group of objects, known as its elements.
There're three major interfaces in Java Collections Framework: List, Set and Map
| Interface | Implementation |
|---|---|
| List | ArrayList, LinkedList |
| Set | HashSet, TreeSet |
| Map | HashMap, HashTable, TreeMap |
In Java, the collection interface is a group of objects, with duplicates allowed.
- Set: No duplicates;
- List: allows duplicates, and introduces positional indexing
- Map: A collection of pairs(key, value). No duplicate keys allowed.
We are users of the Collections. The first thing we need to care about, as a programmer, is what kind of operations we can perform on them.
- Addition (Insertion)
- Removal (Deletion)
- Sorting
- Searching
- Iteration (Traversal)
- Copying (Cloning)