aspose file tools*
The moose likes Beginning Java and the fly likes Hash Map Values Compare with String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hash Map Values Compare with String" Watch "Hash Map Values Compare with String" New topic

Hash Map Values Compare with String

R Karthick

Joined: Feb 11, 2008
Posts: 11
Hi I just want to compare the hash map value with a string. but it is not working for me. Please Help

It is always going to the else loop. i dont know why!

While Printing those values
Sysout((String) map.get("ID")); gives CHECKED
Sysout(temp); gives CHECKED

Kindly solve my problem.
Peter Lawrey
Ranch Hand

Joined: Dec 21, 2008
Posts: 62
Rob Spoor

Joined: Oct 27, 2005
Posts: 19538

Please Be Forthright When Cross Posting To Other Sites.

And like on in that link, once I fix the small compiler errors (especially the missing ) in the if) and replace Sysout with System.out.println, it prints True for me.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Hash Map Values Compare with String
Similar Threads
Alternate way of inserting the values in map?
Concatenating string texts based of key value
Storing a count in a || array
hash map
how to store multiple values in one key in hash table