How to implement HashMap put and get methods without using Java Collection framework?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
How to implement HashMap put and get methods without using Java Collection framework?
Do you want to implement a "map" completely from scratch? It's possible, obvious. The most common and effective type of map is an "hash" map, that is a map based on an internal "hash table". So you must first understand (if you don't know), how an hash table works.
Beware that implementing a very "good", optimal hash table is not an easy task ..... if you accept medium/low performances or not so many sophistications ... just for your study or exercise, it's ok.
For other doubts, please ask. And explain for example what type of keys/values you want to handle (if it's a specific map) or if you want a more "general" map (and eventually if you want to use the Java 5 generics).
Andrea, www.andbin.net — SCJP 5 (91%) – SCWCD 5 (94%)
Useful links for Java beginners – My new project Java Examples on Google Code
Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.