• Post Reply Bookmark Topic Watch Topic
  • New Topic

Needing help with HashMap  RSS feed

 
Matrica Kovolunchy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! I am needing help finishing up a program I am writing for class. The Program compiles fine, but when I try to check whether or not a string exists within a hashmap, it prints out both results of the "test".

Ex. If "Revolution 9" exists in the string, print "....still in table", if it doesn't exist, print " Successfully removed...". The program I have prints both. If someone could help me figure out what I need to do to finish it up, I would be greatly pleased. Thank you for your time! p.s.- the error exists around line 30 or so.

 
Raymond Tong
Ranch Hand
Posts: 255
2
IntelliJ IDE Java Spring
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have an extra semi-colon on line 26.
 
Matrica Kovolunchy
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow...now it works, I need sleep. Thank you!
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that you can shorten this to (which incidentally would have shown the problem during compilation):
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!