What is the difference between the HashMap and the array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between the HashMap and the array?

29th Nov 2015, 1:31 PM
danielle
2 Answers
0
HashMap uses key, values to store data, whereas array is collection of similar data type and you use index to access the data.
19th Jan 2016, 4:17 AM
Umang Pandya
0
Though both are used to store objects but they are completely different on their implementation, working and usage. The main difference between ArrayList and HashMap is that ArrayList is index based data-structure backed by an array while HashMap is map data structure which works on hashing to retrieve stored values. Difference between Hashtable and Dictionary in C# ... Hashtable is loosely typed (non-generic) collection, this means it stores key-value pairs of any data types. Dictionary is generic collection. So it can store key-value pairs of specific data types.
8th Aug 2018, 2:07 AM
deepak sharma
deepak sharma - avatar