This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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: 20078
    
  30

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 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Hash Map Values Compare with String
 
It's not a secret anymore!