?
Solved

HashMap

Posted on 2006-05-01
7
Medium Priority
?
362 Views
Last Modified: 2011-09-20
Hi,

How to declare and use this contructor: HashMap(Map m)
0
Comment
Question by:komlaaa
  • 4
  • 3
7 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 16581858
If you had an existying map and you wanted to create a new map that contained data from existing map you'd use something like:

HashMap map = new HashMap(existingMap);
0
 

Author Comment

by:komlaaa
ID: 16581860

based on this: HashMap.put(Object, Object), I am trying to do something like: HashMap.put("map", new HahMap() )
but it is not letting me.
0
 

Author Comment

by:komlaaa
ID: 16581865
>>HashMap map = new HashMap(existingMap);
how can i add another HashMap to map?

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 92

Expert Comment

by:objects
ID: 16581892
HashMap map = new HashMap();
map.put("map", mapToAdd);
0
 

Author Comment

by:komlaaa
ID: 16581906
i should know this
0
 

Author Comment

by:komlaaa
ID: 16581910
thanks and sorry for asking such questions
0
 
LVL 92

Expert Comment

by:objects
ID: 16581993
s'ok :)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

807 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