In Java, a list interface is an ordered collection of objects in which duplicate values can be stored. Since a List preserves the insertion order, it allows positional access and insertion of elements.
List interface is implemented by the following classes:
A list is an interface and the instances of a list can be created in the following ways:
listType
is the class that is implementing the list interface.objType
is the data type of the values in the listlistName
is the name of the list// Obj is the type of object to be stored in List.ListType<objType> listName = new ListType<objType> ();