Extends the Collection interface.
An interface for ArrayList, LinkedList, Vector and Stack.
List and all List implementations are mutable for element order and element number but not for element type or the elements themselves, the last depends on the element type.
Element type must be a class (wrapper class as well). Elements can not be of primitive type.
In order to use it for handling literals of primitive types, use their wrapper classes.
This is an interface which means no object can be created from it.
For creating instances, use constructors of classes which implement the List interface.
EXAMPLE FOR CREATING INSTANCES:
These instances can use methods in the List interface.
The of() method creates immutable Collection. It is a very fast way to declare a List with its content for e.g. testing purposes but adding, modifying or deleting elements will be impossible.
Solution is using the constructor of the particular List subclass on the immutable List to make it mutable.
EXAMPLE FOR CONVERTING IMMUTABLE LIST TO MUTABLE:
Differences between List and Set:
List can include duplicated elements
List keeps order of its elements