The Collection interface stores a set of objects that are not unique (allow duplicates) and are unordered.
The set interface inherits the Collection interface, storing a unique set of objects that are not allowed to be duplicated or unordered.
The List interface inherits the Collection interface, which stores a set of objects that are not unique (allowing duplicates), ordered (placed in the order in which elements are inserted, and not rearranged).
The implementation of the list interface has two common implementation classes one is ArrayList and linkedlist. They can all accommodate all types of objects, including null, allow repetition, and guarantee the order in which elements are stored
The ArrayList array is encapsulated and the variable-length arrays are implemented. ArrayList stores data in the same way and in the same array, allocating contiguous space in memory. The advantage of this is that it is more efficient to traverse elements and elements randomly to access elements.
The LinkedList uses the list storage method. High efficiency when inserting and deleting elements.
The map interface stores a pair of key-value objects that provide a mapping of the key (key) to value. The key in the map does not require ordering and does not allow duplication. Value also does not require ordering, but allows repetition.
The lterator interface is the interface responsible for defining access and traversal elements.
Common methods:
Collection interface
Add (), remove (), iterator (), size (), clear (), contains (), IsEmpty ()
ArrayList class
Get ()
LinkedList class
AddFirst (), AddLast (), Removefirst (), Removelast (), GetFirst (), GetLast ()
HashSet class
ADD (), remove (), clear (),
HashMap class
Put (key, value), remove (key), get (key), KeySet (), ContainsKey (), Containsvalue ()
Iterator Interface (iterator)
Hasnext (), Next ()
Java Collection Framework