• Post Reply Bookmark Topic Watch Topic
  • New Topic

how do I set all the values in a hashmap<String, Integer> to 0?  RSS feed

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I do this in java 1.6? Thanks.
 
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far? What aspect of it are you having trouble with?

Have you seen anything on the Map interface that might be helpful?
 
Patrick Noah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could use put, but what would the value be? null? And how do I iterate through all values of a newly instantiated hashmap?
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to Javaranch Patrick
Patrick Noah wrote:And how do I iterate through all values of a newly instantiated hashmap?

There will not be any values in a newly instantiated HashMap
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!