Java for Testers - Part 227 - HashSet

preview_player
Показать описание
In this video, I have explained and practically demonstrated the below things on HashSet class of Collections Framework in Java:

* HashSet is the child class of Set interface
* Represents the group of objects as a single entity where
* duplicates are not allowed
* On trying to add the duplicates, the add method returns false and insertion wont happen
* insertion order is not preserved
* null can be inserted
* Uses add() method for adding objects
* Using for-each loop or iterator() methods for retrieving the objects
* Has a child class known as LinkedHashSet
Рекомендации по теме