List is a type of ordered collection that maintains the elements in insertion order while Set is a type of unordered collection, so elements are not maintained any order.
List | Set |
---|---|
The List is an ordered sequence. | The Set is an unordered sequence. |
List allows duplicate elements | Set doesn’t allow duplicate elements. |
Multiple null elements can be stored. | Null element can store only once. |
Elements by their position can be accessed. | Position access to elements is not allowed. |
List implementations are ArrayList, LinkedList, Vector, Stack | Set implementations are HashSet, LinkedHashSet. |