0 votes
1 view
in Java by (3.5k points)
What is the fundamental difference between the Set<E> and List<E> interfaces?

1 Answer

0 votes
by (46.1k points)

The list is an organized sequence of elements whereas Set is a different list of unordered elements 

List<E>:

An ordered collection (also known as a sequence). The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list.

Set<E>:

A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element. As implied by its name, this interface models the mathematical set abstraction.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
asked Oct 3 in Python by Tech4ever (22.4k points)
0 votes
0 answers
asked Nov 20 in Java by Anvi (10.2k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...