File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes HashMap putall() use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HashMap putall() use" Watch "HashMap putall() use" New topic

HashMap putall() use

Aneek Banerjee
Ranch Hand

Joined: Jun 20, 2012
Posts: 61

Hi I have an HashMap and I am trying to copy all the element of that HashMap to another map.Finally I want to itreat through the element of the copied map and printout each element.I have written the below program for this purpose but when I try and run this I am not getting any output.
Please Advice.

Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 235

putAll hm1 Ma.Entry to hm which hm1 is empty
do you mean hm1.putAll(hm) ?
Aneek Banerjee
Ranch Hand

Joined: Jun 20, 2012
Posts: 61


Exactly my mistake.Now working fine.
I agree. Here's the link:
subject: HashMap putall() use
jQuery in Action, 3rd edition