Menu Bar

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Tuesday, 20 December 2016

What is the difference between List and Set Interface In Java ?


Here we list all the differences between List interface and Set interface In Java.


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.
List has one Legacy class i.e. vector.
Set don’t have any Legacy class.
List can be traversed with ListIterator and Iterator.
Set can only traversed with Iterator.
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.



Share this Blog with yours Friends !!

No comments:

Post a Comment