• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

addition of two Hash maps

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having two hash Maps ,?How can I add those two

for Example:

HashMap h1=new HashMap();
h1.add("1997","300");
h2.add("1998","400);

HashMap h2=new HashMap();
h2.add("1997","200");
h2.add("1998","700");

HashMap Total=new HashMap();
I want the resultant HshMap like this
total={(997,500),(1998,1100)};

Any one please give me the code

Tanks&& Regards,
Sireesha
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Any one please give me the code"

Did you think about the problem yourself? What do you think you would need to do to perform this task? Please think about the problem yourself first, when you have thought out how to do it write some code, and if you get stuck post your code here and ask a question about what you don't understand.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic