Java List vs. Set

Both the List interface and the Set interface inherits the Collection interface. However, there exists some difference between them.

  1. Lists can include duplicate elements. However, sets cannot have duplicate elements.
  2. Elements in lists are stored in some order. However, elements in sets are stored in groups like sets in mathematics.

Now that we know what List is, we will see its implementations in ArrayList and LinkedList classes in detail in the next tutorials.