English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Does anyone know where I can find the implemetnation for hashmaps. By that, I mean, how its member functions are implemented? It's inside workings, basically the class/template for a hashmap?

2007-03-15 14:19:23 · 2 answers · asked by passtime 1 in Computers & Internet Programming & Design

This is for c++. are java's and c++'s implementation the same?

2007-03-15 14:27:02 · update #1

2 answers

Go to java.sun.com and download a Java Development Kit (JDK). When installing, make sure the box for "install source" is checked.

It will drop a file called src.zip in the install folder. If you unzip it and go into the src folder you can search for HashMap.java.

That will be the Java implementation of a hashmap. You can also see variations on that, such as Hashtable etc.

2007-03-15 14:24:20 · answer #1 · answered by Anonymous · 0 0

not really the same, but very similar;
Java uses Maps as abstract classes whereby you need to instantiate them with HashMap for instance as;
Map m = new HashMap();
m["IT"] = "Information Technology";
It's important to realize that you need for better performance to override the hash code and equals mothods.
In C++, the STL library offers hash_map; Check http://www.sgi.com/tech/stl/hash_map.html

2007-03-15 23:47:45 · answer #2 · answered by Coosa 2 · 0 0

fedest.com, questions and answers