Java Tutorial For Beginners 35 – HashSet in Java


Video is ready, Click Here to View ×

Find code here –

Java – The HashSet Class
Java Collections Framework Tutorial
Set and HashSet : HashSet
Java Collections – Set
Searches related to java tutorial hashset
java hashset element
java collections tutorial
java iterate hashset
hashset java collections
hashset remove
hashset example in java
java set hashset
java print hashset
HashSet examples

20 thoughts on “Java Tutorial For Beginners 35 – HashSet in Java

  1. The HashSet is an implementation of a stack with unique objects. Hence when you use the Iterator to read through the example provided in the video, it shall print in the order of Last In First Out.

    When you use the add method and put in a duplicate value, there shall be no compile time or run time error, and neither shall it give errors while trying to access. The add method returns false, if the object is a duplicate.

    To remove from the hashset you shall need use name.remove("jack") !

  2. I think UR video must show 2 us the result as follow : when I entered twice time every number in hash list and in link list what's happen?……..
    for (i=0;i<=1;i++)
    for (j=0;j<=5;j++)
    for (i=0;i<=1;i++)
    for (j=0;j<=5;j++)
    ——————————————————————— the result is:
    The HashSet output is:
    0 1 2 3 4 5
    The LinkedList output is:
    0 1 2 3 4 5 0 1 2 3 4 5

Leave a Reply

Your email address will not be published. Required fields are marked *