+ 2

What is hashmap in java ?

Can anyone explain this to me clearly

15th Feb 2019, 8:42 AM
Chandra Prakash Singh Bisht
Chandra Prakash Singh Bisht - avatar
3 Answers
+ 2
HashMap is a data structure that uses a hash function to map identifying values, known as keys, to their associated values. It contains “key-value” pairs and allows retrieving the value by key. They are good to use when you have a large amount of data and you need to check for specific data. https://docs.oracle.com/javase/tutorial/collections/interfaces/map.html
15th Feb 2019, 11:56 AM
( ͥ° ͜ʖ ͥ°)
+ 2
It is like list of values with access keys to them and key name you can choose: brother - John; mother - Marta; uncle - Ban; ... OR 1 - John; 2 - Marta; 3 - Ban; ... With array you call value with index, with hashmap with key.
2nd Mar 2019, 8:53 AM
M_N
+ 2
HashMap is used to storing data in form of index(key) and value
8th Mar 2019, 8:35 AM
Psycho
Psycho - avatar