Here we list all the differences between List interface and Set interface In Java.
Know Also : List / Set / ArrayList / LinkedList / Vector / Stack / HashSet / LinkedHashSet / TreeSet
List
|
Set
|
List contains duplicate elements.
|
Set contains only Unique elements.
|
List is an ordered collection. It maintains insertion order of
elements.
|
Set is an unordered collection. It doesn’t maintain insertion order
of elements.
|
List allows any number of null values.
|
Set allows only single null value.
|
Set don’t have any Legacy class.
|
|
List implementation classes are ArrayList, LinkedList, Stack, Vector.
|
Set implementation classes are HashSet, LinkedHashSet, TreeSet.
|
List allows index based search of any element, using get(E) method.
|
Set doesn’t allows index based search of element.
|
Blog Author - Pushkar Khosla,
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.
This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.
Software Developer by Profession with 3.0 Yrs of Experience , through this blog i'am sharing my industrial Java Knowledge to entire world. For any question or query any one can comment below or mail me at pushkar.itsitm52@gmail.com.
This blog is all about to learn Core Java ,Interview Programs and Coding tricks to polish your Java Knowledge. If you like the content of this blog please share this with your friends.



No comments:
Post a Comment