Java Tutorial For Beginners 35 - HashSet in Java

preview_player
Показать описание
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

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
Рекомендации по теме
Комментарии
Автор

As you can see in output:
Insertion order is not maintained in hashset.
We can't keep our order of o/p in hastset as ascending or descending.

abhishekgandhewar
Автор

I really love your video content and it has helped a lot in my first year of university. Thank you.

bunkbedmedia
Автор

Why hasNext() not printing neither alphabetic nor an order? It's printing like
Tom
Mark
July
Patrik
Jack

The_Real_Living
Автор

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") !

sudiptochatterjee
Автор

ur video are too good and helped in my learning core java.

uksanjay
Автор

Thank you! Good explanation for a beginner such as myself.

dbcarey
Автор

Thank you for this information. How do you print all of elements of this array?

CamiloMonsalve
Автор

You can use recursion and hasnext to get a hasprevious type iteration

Chirag-mbyd
Автор

what exactly is that syso ctrl+shift thing that you do?
How can I do it too?

nikhildakwale
Автор

Great job done...it helped me a lot. tysm

premprakash
Автор

what is the difference between Hashset and List Iterator? both operates the same

rtdhgfgx
Автор

It doesn' t print the names from top to bottom like the ListIterator... actually it prints:
tom
Mark
july
patrik
jack

ektelestis
Автор

why hasnext() does not have neither alphabetic nor an order?
why is output is in zig zag manner?

lokeshreddy
Автор

it would be easy if you give some problems to practice.by that we can easily understand the concepts.

swarnakunchala
Автор

why didn't you use List iterator here?

shagunmalik
Автор

in a hash set values are not sorted in the order of insertion

nadimbaraky
Автор

Hashset doesn't arranges in ascending order using hash next condition check out and rectify bro

rathindanton
Автор

Please Help! When I type in: HashSet<String> name = new HashSet<String>(); it says "HashSet is not generic, it cannot be parameterised with arguments such as <String>"

totalsyambles
Автор

bro HashSet don't have indexing so that don't have previous method

dontblinkmen
Автор

How to print specific index value from hashset?

wajahatahmed