• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Implementing HashMAP

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends

I need help in figuring out how to implement hashMAP CLass implementations without using Javas API

Please let me know if you any website for getting such information. Your suggestions are welcome


Thanks

NEK
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure what you are asking.
If HashMap is part of Java's API, how are you going to implement it without using Java'a API?

Since you spelled it hashMAP, are talking about a different class?
Do you want to write your own class hashMAP that works the same as Java's HashMap?
Could you please clear this up!
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Please confirm that is your real name, or you will have to change it to conform with the naming policy.

Find the Map interface (and also Map.Entry) in the API and read it.
A HashMap is made with an array, default size 16, and a load factor, default 0.75f (75%); whenever the number of entries is greater than load factor * size (starts at 12) the array is replaced by one double the size and its contents redistributed.
The contents of the array are Map.Entry objects with a "K" (key) object and a "V" (value) object; their location is determined by key.hashCode() & (size - 1).
Now you know enough to be able to set up a HashMap yourself, if you insist on "reinventing the wheel."
[ June 26, 2008: Message edited by: Campbell Ritchie ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic