Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating HashMap from map

807601May 4 2008 — edited May 5 2008
Hello, I am learning as much as I can about HashMaps and I understand most of it apart from this:

To create HashMap from map use following constructor

HashMap HashMap = new HashMap(Map myMap);

Could someone please explain to me what is happening here as I'm slightly confused. Is it copying a "collection" from a Map Type (TreeMap, SortedMap, LinkedHashMap, Hashtable.. etc.)? Sorry if it sounds like a simple question but I have no experience with Maps.

Also is it possible to create multi-dimensional HashMaps? If so, how would I declare/initialize one.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2008
Added on May 4 2008
9 comments
1,045 views