This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Hash Map Values Compare with String" Watch "Hash Map Values Compare with String" New topic
Author

Hash Map Values Compare with String

R Karthick
Greenhorn

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.
Thanks.
Peter Lawrey
Ranch Hand

Joined: Dec 21, 2008
Posts: 62
cross-post
http://forums.sun.com/thread.jspa?threadID=5357514&messageID=10557012
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Don't get me started about those stupid light bulbs.
 
subject: Hash Map Values Compare with String
 
Similar Threads
how to store multiple values in one key in hash table
Concatenating string texts based of key value
Alternate way of inserting the values in map?
Storing a count in a || array
hash map