Example & Tutorial understanding programming in easy ways.

What is difference between List and Set?

The difference between List and Set are following:-

                              List                             Set
1 List can contain duplicate values . 1 Set doesn’t allow duplicate. Set interface allows only to unique elements.
2 List is ordered collection based on zero based index. 2 Set is unordered collection ie Set doesn’t ensures the sequence in which data can be retrieved. (except SortedSet)
3 List does not prevent inserting null elements (as many you like). 3 Set will allow only one null element.


Read More →
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!