Link to home
Start Free TrialLog in
Avatar of GAUTAM
GAUTAMFlag for United States of America

asked on

Map Comparion Doubt

Hi Experts...
I have a map whose values are displayed as shown below.

I need to display the results of the comparison only if the key is present in another map say LinkedHashMap<String,Integer> firstMap = new LinkedHashMap<String,Integer>();
How do i achieve this.
Please help...
for(final Entry<String,Boolean> entry : comparisonResult.entrySet())
{ 
		
System.out.println("Entry:" + entry.getKey() + ", value: " + entry.getValue()); 
		
}

Open in new window

Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

check if the
if( map.get( entry.getKey( ) ) == null )
{
  //value doesn't exist
}
ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial