• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
Marshal
Posts: 56610
172
  • 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
 
Ranch Foreman
Posts: 920
26
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.
 
Bartender
Posts: 1603
232
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 .
 
Saloon Keeper
Posts: 18800
74
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.
 
Saloon Keeper
Posts: 7994
143
  • 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!