Solved

Map Comparion Doubt

Posted on 2011-09-14
2
251 Views
Last Modified: 2012-05-12
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

0
Comment
Question by:gaugeta
  • 2
2 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 36535268
check if the
if( map.get( entry.getKey( ) ) == null )
{
  //value doesn't exist
}
0
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 36535278
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 38
Printing to a specific printer tray (HP 806dn printer) 3 83
listing all functions in JavaScript 19 173
Java JRE greater than 1.6 5 50
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now