This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Matching two map values : An exception occured trying to convert String "A" to type "java.lang.Long"

 
Romeo Ranjan
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

Below is the code that I am working on. I want to loop through the values of the hashmap "a" . If the value of map "a" matches the value of map "a1". I want to print the corresponding key "hello" in hashmap a1.



But this is the error that I get



What do I do in order to rectify the exception. And how do I get the "hello" displayed in the jsp page?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd assume there's some type coercion going on here, thus the error.
 
Bhoomika Bathla
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.....

I run your code in eclipse......it does not show any exception.
 
anbuselvan angamuthu
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess you put integer value "new Integer(3)" in a1 map.so you put "new Integer(3)" instant of "new String(3)"
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic