+ 3
Hashmap in java?
What is the difference between hashmap and hashtable? Can we use INTEGERS as Keys for accessing?
1 ответ
+ 7
Nishtha
HashMap
-They are non-synchronised.
-They aren't thread safe.
-That means multiple threads can operate -same on map object at a same time.
-Because it's not a thread safe so the -performance will be high.
-Null insertion allowed for both key and value.
Hashtable
-They are synchronised.
-They are thread safe.
-That means only threads can operate a object at a time.
-Because it's a thread safe so the performance will be low.
-Null insertion not allowed for key and value.
Yes you can use Integer as a key.
For Internal working of Hashmap:-
https://www.sololearn.com/post/501453/?ref=app