Results 1 to 4 of 4

Thread: hashCode() algorithm

  1. #1

    Question hashCode() algorithm

    Does anybody know the algorithm that java uses to get the hashCode for the built in hash table...or can any body give me the source code for that method. It is for a java assignment and i cant figure out that pattern by looking at the numbers, and i couldnt find the actual code in the API

    any help would be great, THANKS
    [gloworange]Antyx[/gloworange] .. formerly lupdawg

  2. #2
    Senior Member
    Join Date
    Aug 2003
    Posts
    1,018
    Stupid question, because I am only about 6 weeks into java....

    If you know the library it is in ( java.lang.Object ) then why not snoop around a little in the classes and figure it out? That's what I have been doing, and how I found examples of parameter passing in instantiable classes....

    and i couldnt find the actual code in the API
    Wouldn't that be because that just gives you the syntax necessary to make the call?

    Just my input....I've got my own java homework to figure out.

  3. #3
    i know how to use the method, i know how to call the method...but i need the actual algorithm of the method. the method takes a string, and spits back out a int. how does it get from point a to point b... i need that 'formula' and i was searching all the documentation for the actaul source code...i mis typed it and said the API

    Thanks for the help tho
    [gloworange]Antyx[/gloworange] .. formerly lupdawg

  4. #4
    Banned
    Join Date
    Aug 2003
    Posts
    130
    Well it would help if you gave us the numbers so we could work with them.
    A simple google search found this website
    http://mindprod.com/jgloss/hashtable.html
    that might help.
    Is it a homemade algorithm or is it a known one?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •