• Post Reply Bookmark Topic Watch Topic
  • New Topic

Map or HashMap?  RSS feed

 
auvrm papu
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When to use Map over HashMap?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ais Kaly:
When to use Map over HashMap?


Map is an interface which is implemented by the HashMap class. So, when you use a HashMap, you are also using the Map interface. You are using both.

Henry
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as Java Docs says : Hash table based implementation of the Map interface. This implementation provides all of the optional map operations.
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!