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...❤️
@SarangHoley4 жыл бұрын
Yes Naveen had earned the respect by giving very good content & with correct direction to the community, he is best always 😊👍
@bkumarj64504 жыл бұрын
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...
@prasadnangarale34572 жыл бұрын
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🙏🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻💞💞💞
@kunalsinha59423 жыл бұрын
Naveen - Q no : 10 - It can store multiple duplicate values as long as keys are different..
@sureshgarine4 жыл бұрын
This is really useful and much needed. Thanks for your service to the community.
@ABAutomationHub Жыл бұрын
Excellent explanation as always. Thanks for creating this video. This is very much needed!
@mysticalprodigy7203 жыл бұрын
Naveen -you are simply superb, in one word all I can say is you have solved the pain of million automation associates .
@shilpashravge5393 Жыл бұрын
Perfectly summarized. Appreciate your time and efforts !
@palspal23293 жыл бұрын
Thanks sir for making such greatly needed topic wise videos
@santoshkpl20884 жыл бұрын
Thank you so much for all Hashmap videos sir and happy kannada rajyotsava..
@naveenautomationlabs4 жыл бұрын
Same to you :)
@santoshkpl20884 жыл бұрын
@@naveenautomationlabs thanks sir
@jeyhunaliyev17654 жыл бұрын
Awesome i was waiting for this Thank you very much for your help
@ishabiswas45563 жыл бұрын
Very Informative Thanks for sharing 👍 Really appreciate your efforts
@artimandale82868 ай бұрын
Simply amazing 👌
@jugautomation31024 жыл бұрын
Great Questions Sir. Hats off.
@puneetsaneja30073 жыл бұрын
On what basis binary tree decide what to store left and what to store on right ? Is it by hashcode value ?
@11223a3b2 жыл бұрын
Wonderful video ☺️
@minigupta6478 Жыл бұрын
Appreciated Thanks for creating this video
@dystopianNinja12893 жыл бұрын
Amazing video. Thank you Naveen
@parulgarg74293 жыл бұрын
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-qh4ow3 жыл бұрын
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.
@hiteshdarji9925 Жыл бұрын
Awsome video. One query Navin bhai what is multi threading how its performing in java and impact on hashmap value?
@sreenivasl2213 жыл бұрын
Very helpful your tutorials, Thank you sir!!!
@vivekkeshari68964 жыл бұрын
🙏🙏🙏🙏 great effort in creating this ...👍👍👍👍👍👍👍👍 thanks Naveen
@naveenautomationlabs4 жыл бұрын
My pleasure 😊
@healthbeautytips64383 жыл бұрын
Thanks Naveen for such a good content
@naveenautomationlabs3 жыл бұрын
Thanks for watching
@thunikilokesh12803 жыл бұрын
Thank you so much for the collections Why dont you try multithreading and spring boot?
@ARCHIT9804 жыл бұрын
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)
@ARCHIT9804 жыл бұрын
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-qh4ow3 жыл бұрын
@@ARCHIT980 you are right.
@danceayush81283 жыл бұрын
Great explanation 👍
@travelandspiritual4 жыл бұрын
Congrats for 132 K Subscribers in your channel .
@naveenautomationlabs4 жыл бұрын
Thank you vinod
@rajatagrawal70164 ай бұрын
thanks a lot
@priyankabakshi97653 жыл бұрын
Hi Naveen, Why equals and hashcode implementation is required for the key and value both if this is needed only for the key..
@AmitKumar-qh4ow3 жыл бұрын
hashcode and equals methods implementation is required for key not for value.
@roopadolli19103 жыл бұрын
Nice Naveen.. 🙏
@pa1gupta3 жыл бұрын
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.
@harithasri83722 жыл бұрын
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?
@solankijigar113 жыл бұрын
Great job......
@ajaypaul_dancer2 жыл бұрын
Superb
@nandhinimathivanan39983 жыл бұрын
In linked hashmap collision occurs ah Naveen
@RohitSingh-br3xd4 жыл бұрын
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?
@vijaythavva38223 жыл бұрын
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.
@juhiagarwal76823 жыл бұрын
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.
@shankarpk893 жыл бұрын
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.
@daisyd41722 жыл бұрын
💛
@amritasharma53904 жыл бұрын
Thank you so much 👍
@naveenautomationlabs4 жыл бұрын
You are welcome
@kumargaurav43623 жыл бұрын
Sir, could you please clear the concepts of IO ad NIO package in Java. It would be very helpful.
@nikhildsouza890511 ай бұрын
Just FYI , Answer for 10 ) one is Yes , we can have duplicate values with different keys
@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); } }