Well this is the one which was very much needed.before it started i had handful of questions,but believe me it miraculously clarified all of my doubts. Thanks a lot Naveen🙏 you deserve respect...❤️
@SarangHoley
3 жыл бұрын
Yes Naveen had earned the respect by giving very good content & with correct direction to the community, he is best always 😊👍
@prasadnangarale3457
2 жыл бұрын
Your teaching is very very nice...realy from my heart ..thank you ,thank you, thank you...I found your channel firstly at javaMCAP course there are your vedios for collection framework... Great teaching🙏🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻💞💞💞
@kunalsinha5942
3 жыл бұрын
Naveen - Q no : 10 - It can store multiple duplicate values as long as keys are different..
@ARCHIT980
3 жыл бұрын
Hi Naveen Thanks for the amazing video. In question 10 I have a doubt: We can store duplicate value in Java HashMap: Corresponding to different keys we can have the same values. for e.g hm.put("Archit",1) hm.put("Naveen",1)
@ARCHIT980
3 жыл бұрын
Also in Question 21 When two keys are having the same hascode? Yes, obviously the Collison will happen. But after it will check using equals() method whether the two keys are same or not. if not same then it will create a node in the particular index of the bucket else it will override the value. @Naveen please correct me if am wrong.
@AmitKumar-qh4ow
3 жыл бұрын
@@ARCHIT980 you are right.
@rajatagrawal7016
Ай бұрын
thanks a lot
@hiteshdarji9925
10 ай бұрын
Awsome video. One query Navin bhai what is multi threading how its performing in java and impact on hashmap value?
@nityaranjan6714
Жыл бұрын
Can you sort HashMap in java? I feel answer is yes. As we can sort it according to keys or values also. Like below for sort it accordingly to keys. public class SortedHashMap { public static void main(String[] args) { HashMap hm = new HashMap(); hm.put(2, "B"); hm.put(1, "A"); hm.put(4, "D"); hm.put(3, "C"); Map sortedMap = hm.entrySet().stream().sorted((a,b) ->a.getKey().compareTo(b.getKey())).collect(Collectors.toMap(Entry::getKey, Entry::getValue,(e1,e2) ->e1)); System.out.println(sortedMap); } }
@nikhildsouza8905
8 ай бұрын
Just FYI , Answer for 10 ) one is Yes , we can have duplicate values with different keys
@ABAutomationHub
Жыл бұрын
Excellent explanation as always. Thanks for creating this video. This is very much needed!
@puneetsaneja3007
3 жыл бұрын
On what basis binary tree decide what to store left and what to store on right ? Is it by hashcode value ?
@bkumarj6450
3 жыл бұрын
I am following Naveen from 10k subscribers and he helped me a lot in my automation career...now the count is growing hope it will reach to an infinite loop...
@sureshgarine
3 жыл бұрын
This is really useful and much needed. Thanks for your service to the community.
@daisyd4172
2 жыл бұрын
💛
@jeyhunaliyev1765
3 жыл бұрын
Awesome i was waiting for this Thank you very much for your help
@thunikilokesh1280
3 жыл бұрын
Thank you so much for the collections Why dont you try multithreading and spring boot?
@palspal2329
3 жыл бұрын
Thanks sir for making such greatly needed topic wise videos
@parulgarg7429
3 жыл бұрын
Hi Naveen , every concept is very well explained. Can you please include this question as well and explain :->what if we don't override the hashcode() /equals() method in our custom classes. thx
@AmitKumar-qh4ow
3 жыл бұрын
if we will not override hashCode() method in in our custom class then default implementation of hashCode() will be called which is present in Object class, we will get a unique number for every object of custom class whether two objects contain same info like id and name are same e.g Employee emp1=new Employee(101, "Naveen"); Employee emp2(101,"Naveen"); there are two object emp1 and emp2 having same id and name, still we will get different hashCode() for every object, by using int hashCode Value1=emp1.hashCode(); System.out.println(hashCodeValue1) and using int hashCodeValue2=emp1.hashCode(); System.out.println(hashCodeValue2); we will get different hashcode value for both objects if you we will not override hashCode() method but if we will override hashCode() method based upon these two attribute id and name, we will get same hashcode value for two objects having same info (means we are putting same employee info two times) like above where id and name is same.
@11223a3b
2 жыл бұрын
Wonderful video ☺️
@harithasri8372
2 жыл бұрын
If HashMap internally uses Hashtable, then how come it is accepting null key? because hashtable do not allow nulll values. My doubt is while inserting values inside hashmap, where they will get inserted? in hashtable or at that index of hashtable new linked is created?and first element is added in that list?
@ishabiswas4556
3 жыл бұрын
Very Informative Thanks for sharing 👍 Really appreciate your efforts
@travelandspiritual
3 жыл бұрын
Congrats for 132 K Subscribers in your channel .
@naveenautomationlabs
3 жыл бұрын
Thank you vinod
@santoshkpl2088
3 жыл бұрын
Thank you so much for all Hashmap videos sir and happy kannada rajyotsava..
@naveenautomationlabs
3 жыл бұрын
Same to you :)
@santoshkpl2088
3 жыл бұрын
@@naveenautomationlabs thanks sir
@minigupta6478
Жыл бұрын
Appreciated Thanks for creating this video
@shilpashravge5393
Жыл бұрын
Perfectly summarized. Appreciate your time and efforts !
@pa1gupta
3 жыл бұрын
Is threshold value 8 to convert from linkedlist to balanced tree? I see at 8 it will reorganize by increasing the size of hashmap, at 64 it will convert to tree. I see value Min_treeify = 64. Also can you explain at what threshold it will convert back to linkedlist from tree.
@ajaypaul_dancer
2 жыл бұрын
Superb
@vijaythavva3822
3 жыл бұрын
When we trying to add duplicate key with same value or new value , it will override with new value. Here my question is what happens to that old value , is it stored in somewhere or is it garbage collected ? i was faced this question in an interview.
@nandhinimathivanan3998
3 жыл бұрын
In linked hashmap collision occurs ah Naveen
@healthbeautytips6438
3 жыл бұрын
Thanks Naveen for such a good content
@naveenautomationlabs
3 жыл бұрын
Thanks for watching
@sreenivasl221
3 жыл бұрын
Very helpful your tutorials, Thank you sir!!!
@RohitSingh-br3xd
3 жыл бұрын
Hi Naveen, what if we want to get old value for duplicate keys? Is there any way we can get old value instead of the latest?
@dystopianNinja1289
3 жыл бұрын
Amazing video. Thank you Naveen
@priyankabakshi9765
3 жыл бұрын
Hi Naveen, Why equals and hashcode implementation is required for the key and value both if this is needed only for the key..
@AmitKumar-qh4ow
3 жыл бұрын
hashcode and equals methods implementation is required for key not for value.
@mysticalprodigy720
3 жыл бұрын
Naveen -you are simply superb, in one word all I can say is you have solved the pain of million automation associates .
@juhiagarwal7682
3 жыл бұрын
Thank you Naveen for making such informative videos. I have a confusion regarding keys returning same hashcode, if it happens how will get method return right value for corresponding key as hashcode is stored in node values to perform equals method, I think its index value which is returned same.Correct me if I am wrong.
@shankarpk89
3 жыл бұрын
hashcode = get(key) - internally the hashcode of this key is calculated then this hashcode is passed as an argument to hash function and then this hash value is passed to indexFor method which calculates the index/bucket/node. Then the equals method is invoked which checks whether the key passed matches with the key present at that particular node if the key matches then the value corresponding to the key is returned but if the key does not match which could be the case when multiple keys have the same hashcode i.e. collision case in this case at the same index we have multiple nodes in which object is stored as a linked list. So if the key does not match with the 1st key present at that node then the same operation is repeated until the key matches.
@artimandale8286
5 ай бұрын
Simply amazing 👌
@jugautomation3102
3 жыл бұрын
Great Questions Sir. Hats off.
@vivekkeshari6896
3 жыл бұрын
🙏🙏🙏🙏 great effort in creating this ...👍👍👍👍👍👍👍👍 thanks Naveen
@naveenautomationlabs
3 жыл бұрын
My pleasure 😊
@danceayush8128
3 жыл бұрын
Great explanation 👍
@roopadolli1910
3 жыл бұрын
Nice Naveen.. 🙏
@solankijigar11
3 жыл бұрын
Great job......
@amritasharma5390
3 жыл бұрын
Thank you so much 👍
@naveenautomationlabs
3 жыл бұрын
You are welcome
@kumargaurav4362
3 жыл бұрын
Sir, could you please clear the concepts of IO ad NIO package in Java. It would be very helpful.
Пікірлер: 55