This week's giveaway is in the Spring forum.
We're giving away four 3 month subscriptions to Marco Behler Videos and have Marco Behler on-line!
See this thread for details.
Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between Hashmap in java and dictionary object in other programming language ?  RSS feed

 
narayan lakshmis
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are Hashmap in java similar to dictionary object in programming language
 
Campbell Ritchie
Marshal
Posts: 54909
155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through the Java™ Tutorials and the documentation for Map and HashMap and you will find out
 
Pete Letkeman
Ranch Hand
Posts: 184
8
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I may @narayan lakshmis. By "other programming language" which exactly do you mean? Some languages may in fact support/implement Hashmap just like Java does while other may not support this at all. Perhaps a with a little more context you will find the answer to your question.

Are you looking into transferring skills from C#, PHP or some other programming language to Java? I'm fairly certain that there are tutorials and books for programmers coming from C#, PHP, Python, C++ and more who wish to learn Java.
 
Ron McLeod
Saloon Keeper
Posts: 1530
210
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
narayan lakshmis wrote:...similar to dictionary object in programming language

Do you mean an ASP VB Dictionary Object?
 
narayan lakshmis
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right .I have used Dictionary object in vb script.I want to use the same concept in java .
 
Tim Holloway
Saloon Keeper
Posts: 18637
70
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Technically, a "dictionary" in Java is a Map. HashMap is an implementation of Map that uses a hash table to optimize searches. Other architectures are also possible, such organizing entries via a tree of keys (TreeMap) and even user-defined extensions where, for example, the elements might actually live on a database server or web service.

Map is the abstract interface for a dictionary and that allow you to swap out different implementations as you need. Most languages with built-in dictionaries tend to have the dictionary interface and its implementation be the same thing. But it very much depends on how the language has been implemented.
 
Stephan van Hulst
Saloon Keeper
Posts: 7507
135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java's equivalent would be LinkedHashMap. I don't know if VBScript uses a true hash table implementation, or simply a linked list of key-value pairs.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!