Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8018711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:11:30+00:00 2026-06-04T21:11:30+00:00

Possible Duplicate: How to compare two hashmaps in java? Hi i have two different

  • 0

Possible Duplicate:
How to compare two hashmaps in java?

Hi i have two different has maps which has got values like the following

Map,

1.=============Employee=================


Key : 1_10 : Value : 13/04/2012
Key : 1_11 : Value : 18/04/2012
Key : 1_12 : Value : 19/04/2012
Key : 1_14 : Value : 23/04/2012
Key : 1_13 : Value : 20/04/2012
Key : 1_16 : Value : 25/04/2012
Key : 1_1  : Value : 02/04/2012
Key : 1_15 : Value : 24/04/2012
Key : 1_18 : Value : 27/04/2012
Key : 1_3  : Value : 04/04/2012
Key : 1_17 : Value : 26/04/2012
Key : 1_2  : Value : 03/04/2012
Key : 1_5  : Value : 06/04/2012
Key : 1_19 : Value : 30/04/2012
Key : 1_4  : Value : 05/04/2012
Key : 1_7  : Value : 10/04/2012
Key : 1_6  : Value : 09/04/2012
Key : 1_9  : Value : 12/04/2012
Key : 1_8  : Value : 11/04/2012

2.=============Working day=================

Key : 27 : Value : 27/4/2012
Key : 02 : Value : 02/4/2012
Key : 26 : Value : 26/4/2012
Key : 19 : Value : 19/4/2012
Key : 11 : Value : 11/4/2012
Key : 04 : Value : 04/4/2012
Key : 30 : Value : 30/4/2012
Key : 06 : Value : 06/4/2012
Key : 13 : Value : 13/4/2012
Key : 09 : Value : 09/4/2012
Key : 03 : Value : 03/4/2012
Key : 23 : Value : 23/4/2012
Key : 20 : Value : 20/4/2012
Key : 16 : Value : 16/4/2012
Key : 10 : Value : 10/4/2012
Key : 18 : Value : 18/4/2012
Key : 25 : Value : 25/4/2012
Key : 17 : Value : 17/4/2012
Key : 12 : Value : 12/4/2012
Key : 24 : Value : 24/4/2012
Key : 05 : Value : 05/4/2012

I just want to compare these two hash maps and give values which are not present in maps over the other one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:11:31+00:00Added an answer on June 4, 2026 at 9:11 pm

    suppose map1 is hashmap of your 1st map and map2 is hashmap of your 2nd map. Then,

    Collection<String> c1 = map1.values();
    c1.removeAll(map2.values());  // this one removes all the values from c1 which are also in map2.
    Iterator<String> it = c1.iterator();
    while (it.hasNext()) {
        System.out.println(it.next());
    }
    

    hence you get the values which map1 contains which map2 does not contain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to compare two arraylist? I have two String ArrayLists of different
Possible Duplicate: Compare dates in java I am getting two dates from server in
Possible Duplicate: A better way to compare Strings which could be null I have
Possible Duplicate: How do you compare two version Strings in Java? I've 2 strings
Possible Duplicate: Compare 2 dates with JavaScript I would like to have a Javascript
Possible Duplicate: How to compare two dates in Objective-C I'd like to pop up
Possible Duplicate: PHP compare array I have to compare two arrays in php and
Possible Duplicate: Using jQuery to compare two arrays I have to send the form
Possible Duplicate: Compare 2 dates with JavaScript Compare two dates in JavaScript I am
I have two tables that I would like to compare for duplicates. These tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.