Solved

Map Comparion Doubt

Posted on 2011-09-14
2
256 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

688 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