Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hash Map  RSS feed

 
mythily prakash
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could any body tell me how to create a Hash Map in java.I just want to use it inorder to reduce the Ifs in my program.
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mythily prakash:
could any body tell me how to create a Hash Map in java.I just want to use it inorder to reduce the Ifs in my program.


I guess this question should go Java in General (beginner)

To answer your query what is your requirement?

You can crate HashMap using its default or other constructors. For ex:
HashMap hashMap = new HashMap() and then put values using put() method.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!