http://java9s.com
A Set is a collection of Unique elements.
Set implementation like HashSet, LinkedHashSet and TreeSet should not allow any duplicate object into it.
HashSet is only Unordered and UnSorted. LinkedHashSet is an ordered collection based on the insertion.
Coming to TreeSet, it sorts all its elements so they are ordered based on the sorting criteria.
HashSet is Unordered and Unsorted collection.
It does not allow duplicates and we cannot predict the iteration order.
Then linkedhashSet is ordered as it arranges the elements in the same order as they were inserted.
It also does not allow duplicates
The iterator fetches the elements as they were inserted. So, if you want a collection which should not allow duplicates and should maintain the order, then we can use LinkedHashSet
Complete Generics Tutorials playlist
• Generics in Java Tutorials | Java9s T...
Complete Java Beginners Tutorials:
• Complete Java Tutorials | java progr...
Multithreading in Java tutorial:
• Multithreading in Java Tutorials by J...
Spring 3 MVC Framework tutorials:
• Spring 3 MVC Framework Tutorials
Spring Framework Tutorials:
• Spring Framework Tutorials | Java9s
Design Patterns in Java:
• Design Patterns Tutorials in Java | G...
Auf dieser Seite können Sie das Online-Video Java Collections Tutorials 05 | HashSet and LinkedHashSet in java | Java9s.com mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer java9s 07 April 2016 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 14,272 Mal angesehen und es wurde von 92 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!