#24 - How HashSet works Internally? Do you know HashSet uses HashMap Internally? (Java Collection)

  Рет қаралды 58,793

Naveen AutomationLabs

Naveen AutomationLabs

3 жыл бұрын

In this video, I have explained How HashSet works Internally? Do you know HashSet uses HashMap Internally?
This is a quite famous interview question, and most of the people are not sure of this concept.
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
kzbin.info%20Au...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/COJqZUPB02r5sB7...
Paid courses (Recorded) videos:
naveenautomationlabs.com/reco...
For Java & Selenium - naveenautomationlabs.com/selen...
For API (Manual + Automation) - naveenautomationlabs.com/manua...

Пікірлер: 44
@sumitkumar-kg1xb
@sumitkumar-kg1xb 2 жыл бұрын
Supper point-to-point explanation.. Great thanks for making such a good video.
@chemudupatikarthik8
@chemudupatikarthik8 2 жыл бұрын
Wonderful explanation. Thank you so much!
@manojvg2646
@manojvg2646 Жыл бұрын
wha what an explanation , exactly what I want to learn
@nadaquever5161
@nadaquever5161 Жыл бұрын
killer interview question ;v
@Hadabe-nai
@Hadabe-nai 2 жыл бұрын
Great piece of information. Thank you 😀
@azeemmirza9855
@azeemmirza9855 3 жыл бұрын
Your explanation is on point bro...thanks
@hiteshdarji9925
@hiteshdarji9925 8 ай бұрын
Naveen bhai In debug mode no table showing.Baki aapka video kamal ka he . Maja aa gaya.
@adaickalam
@adaickalam 3 жыл бұрын
well explained... thank you.
@madansingh-rw9ve
@madansingh-rw9ve Жыл бұрын
your content awesome, thank you for providing great content
@vedantupadhyay5927
@vedantupadhyay5927 4 ай бұрын
Can you provide link which you open at end of video where souce code of hashSet there. Please
@DurgaShiva7574
@DurgaShiva7574 3 жыл бұрын
what a video....what a quality content , what a learning...THANKS A TON SIR..
@vivekpathak3643
@vivekpathak3643 Жыл бұрын
This video really helped, thankyou!
@tannubajpai4782
@tannubajpai4782 3 жыл бұрын
best explanation by u Sir
@linexustjk6061
@linexustjk6061 Жыл бұрын
Thanks a lot... This is helping a lot
@bhushan7546
@bhushan7546 2 жыл бұрын
very nice and clear explanation 😊
@jainlove
@jainlove 2 жыл бұрын
Amazing series ❤️
@harshachakraborty3505
@harshachakraborty3505 2 жыл бұрын
This is very useful 👍
@niteshpandey8207
@niteshpandey8207 Жыл бұрын
great explanation thank you.
@jajatisahoo3831
@jajatisahoo3831 2 жыл бұрын
Awesome
@priyanshusinha7056
@priyanshusinha7056 3 жыл бұрын
Thanks bro ❤️❤️❤️❤️
@rakhikhatri8878
@rakhikhatri8878 3 жыл бұрын
As in your video we can see HashMap while debugging the code but same way I am doing but unable to see HashMap after adding string value. please tell me where I am doing mistake.
@saxenahimanshu6584
@saxenahimanshu6584 3 жыл бұрын
Nice Info but I unable to open that info while hover toggle point and display map then table , etc, the version I am using on windows won't provide that many details. Please provide some solution for this. Thanks
@AjayKumar-ju6sl
@AjayKumar-ju6sl 3 жыл бұрын
Sir , How constructor with Collections works ??
@ravikumaryerrolla8974
@ravikumaryerrolla8974 3 жыл бұрын
Very well explained Naveen, however what I observed here, if HashSet not follow insertion order then why is it implementing SortedSet interface, I believe HashSet extends AbstractSet and implements Set interface. Please Advise if am wrong.
@martingalvan1446
@martingalvan1446 3 жыл бұрын
HashSet do not implement SortedSet interface
@jananiramesh6978
@jananiramesh6978 Жыл бұрын
I have a doubt, does present stores the address of null value? So it points to null ?
@sriramkukkadapu
@sriramkukkadapu 3 жыл бұрын
Nice explanation but why it is implemented this way ? Is there any advantage of doing it this way ? And what is the use of the PRESENT object ? @Naveen
@B-Billy
@B-Billy 3 жыл бұрын
1. Reusability of code. 2. PRESENT is used because Map required a value if you want to store something into it. So PRESENT fulfilled that requirement.
@pratapjavasingh3239
@pratapjavasingh3239 3 жыл бұрын
As u know set will not Store the duplicate value but did u ever though how exactly set will not Store the value that reason is set algorithm is written in such way that check if u are add the elements throughout the add method then internally ur source code interpret according to ur jdk inside classloader and it will call the specific for set library and then set algo library check in same way if u are not comfortable "Present" then u can take any variable and it is same work as a Boolean to check data is already present or not and u want see ur source code if u decompile there Present is available and if u want create ur own custom set then followed the same approach whatever for writen is set algorithm
@muzamils.l.236
@muzamils.l.236 3 жыл бұрын
thanks naveen didn't knew until i watch this👍
@shubhampandey8765
@shubhampandey8765 3 жыл бұрын
HashSet doesn't allow duplicates, isn't "over here" is repeated "over here" ? :) Jokes apart, nice explanation though.
@VaniDatta
@VaniDatta 3 жыл бұрын
When I mouse over I can see Hash Code but can not see Java.Lang.object@address. Why? Thanks much in advance 🙏
@kalpanan7164
@kalpanan7164 3 жыл бұрын
For me also same thing happened
@kumarjadhav6106
@kumarjadhav6106 Жыл бұрын
public class Emp{ int id; String name; //Constructor overrided with args public static void main(String[] args){ Emp e1=new Emp(1,"A"); Emp e2=new Emp(1,"A"); Emp e3=new Emp(1,"A"); Emp e4=new Emp(1,"A"); Set set= new HashSet(); set.add(e1); set.add(e1); set.add(e2); set.add(e3); set.add(e4); System.out.println(set); } } Please explain this scenarios When hashcode and equals both overrided or any one of them is overrided or none of them are overrided
@glennmaxi7542
@glennmaxi7542 3 жыл бұрын
is hash collision happens in hashset?
@KunalSharma-ki8rd
@KunalSharma-ki8rd 3 жыл бұрын
Yes, As It uses the same implementation of HashMap So If we continue on this then we can goto the Bucket Size, Collision Handling Balanced Binary Tree. Everything is same!
@kumarjadhav6106
@kumarjadhav6106 3 жыл бұрын
What happens when we add duplicate objects.?
@B-Billy
@B-Billy 3 жыл бұрын
If the object already exists, it does not store the object and return false.
@surajgoenka
@surajgoenka 3 жыл бұрын
You didn't tell what if we try to add duplicate element
@crimsonx_
@crimsonx_ 3 жыл бұрын
When u add duplicate hashset simply ignore.. ignore in a sense that it is overwriting the previous value with new one. if i add "abc" again i add "abc" both are same value previous abc will be overwritten.
@crimsonx_
@crimsonx_ 3 жыл бұрын
see his hashmap implementation video.
@himanshumamodiya1827
@himanshumamodiya1827 3 жыл бұрын
why they have implemented in this way ?
@dharanyuvi6951
@dharanyuvi6951 2 жыл бұрын
I think the developers might have thought to implement a list like datastructure with hashing in it. This is just my assumption.
Java JDk 8 to JDK 15 - All Important Features || A Must Watch For Interview
38:41
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 77 МЛН
Best KFC Homemade For My Son #cooking #shorts
00:58
BANKII
Рет қаралды 62 МЛН
#15 - Top 20 HashMap Interview Questions in Java || By Naveen AutomationLabs
27:35
Set and HashSet in Java - Full Tutorial
20:43
Coding with John
Рет қаралды 205 М.
LinkedHashMap and LinkedHashSet in Java | Internal Working
16:58
Daily Code Buffer
Рет қаралды 19 М.
Core JAVA: How does HashSet work internally? Implementation |  Why are its elements unique?
10:19
HashTable vs HashMap vs Concurrent HashMap all kinds of Map implementations
41:26
Лазер против камеры смартфона
1:01
NEWTONLABS
Рет қаралды 710 М.
НЕ БЕРУ APPLE VISION PRO!
0:37
ТЕСЛЕР
Рет қаралды 315 М.
S24 Ultra and IPhone 14 Pro Max telephoto shooting comparison #shorts
0:15
Photographer Army
Рет қаралды 9 МЛН
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 3,5 МЛН
Как бесплатно замутить iphone 15 pro max
0:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 6 МЛН