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...
In questa pagina del sito puoi guardare il video online Java Collections Tutorials 05 | HashSet and LinkedHashSet in java | Java9s.com della durata di ore minuti seconda in buona qualità , che l'utente ha caricato java9s 07 aprile 2016, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 14,272 volte e gli è piaciuto 92 spettatori. Buona visione!