What is the difference between hashmap and arraylist?



What is the difference between hashmap and arraylist?..

Answer / Abhash Mitra

A HashMap is a data structure that implements an associative array or dictionary, storing key-value pairs. An ArrayList, on the other hand, is a dynamic array that can resize itself as elements are added or removed. The main difference lies in their methods of accessing and retrieving data - HashMap uses keys, while ArrayList uses indexes.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What do you mean by open addressing?

1 Answers  


Should I use hashmap or hashtable?

1 Answers  


Can arraylist shrink?

1 Answers  


Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?

1 Answers  


What is array sort?

1 Answers  


What does arraylist remove return?

1 Answers  


Why insertion is faster in linked list?

1 Answers  


Can we put null key in hashmap?

1 Answers  


What is binary search in programming?

1 Answers  


Define root?

1 Answers  


What are the advantages of merge sort?

1 Answers  


What do u mean by array?

1 Answers  


Categories