I have a String name & Map m, in my bean class. I have get & set methods on both.To Display the String name, i doThe above one works fine.Te below one, displays the entire Map contentsI know the KEY, how do i display the VALUE for that KEYregards,gautam.

Showing Answers 1 - 1 of 1 Answers

Nikhil

  • Jun 1st, 2006
 

If you have key with you then :map.get(key) gives you the value of the key in the map.or Map displayMap // lets say you have displayMap as a Map variableSet entrySet = displayMap.entrySet(); for(Iterator iter = entrySet.iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry)iter.next(); String key =(String)entry.getValue(); String value = (String)displayMap.get( entry.getKey()); }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions