Results 1 to 5 of 5

Thread: [RESOLVED] Need an explanation of a java function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2010
    Posts
    68

    Resolved [RESOLVED] Need an explanation of a java function

    Hello Java lovers,
    I have query about java hashcode method

    what is difference in between hashcode and array.hashcode

    what is the output of hashcode("a") and array of hashcode("a","b")

    Actually i don't understand how array of hashcode works,thats why need explanation about those
    reply on various posts make you a power poster,may not being u a helpful poster,if u dn't understand how u help then dn't need to reply,it increases ur post count,but decreases ur worthness

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: Need an explanation of a java function

    I'm no Java expert (or user for that matter) but I'd have to guess that hashcode returns a single value - the hash of the passed in string... array.hashcode on the other hand would produce an array of hashcodes, one for each string parameter passed in.

    But that's jsut my guess.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2010
    Posts
    68

    Re: Need an explanation of a java function

    oh first of all,thanks to you for your response.

    string a = "a" then a.hashcode = 97 that's a single parameter

    then char a = new array {a,b} and a.hashcode means combination of both array hashcode value,or something

    actually,i wanna convert java array hashcode to vb6 and i have single hashcode function

    now i expecting whats going on array hashcode in java that i can convert for vb6
    reply on various posts make you a power poster,may not being u a helpful poster,if u dn't understand how u help then dn't need to reply,it increases ur post count,but decreases ur worthness

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2010
    Posts
    68

    Re: Need an explanation of a java function

    oh first of all,thanks to you for your response.

    string a = "a" then a.hashcode = 97 that's a single parameter

    then char a = new array {a,b} and a.hashcode means combination of both array hashcode value,or something

    actually,i wanna convert java array hashcode to vb6 and i have single hashcode function

    now i expecting whats going on array hashcode in java that i can convert for vb6
    reply on various posts make you a power poster,may not being u a helpful poster,if u dn't understand how u help then dn't need to reply,it increases ur post count,but decreases ur worthness

  5. #5
    Addicted Member
    Join Date
    Oct 2008
    Location
    Califorina
    Posts
    235

    Re: Need an explanation of a java function

    Check the Java docs http://docs.oracle.com/javase/7/docs...il/Arrays.html

    String a = "a" per the java docs is returning the hashcode for the string object.

    array.hashCode() per the java docs Returns a hash code based on the contents of the specified array.
    Last edited by smendoza; Mar 26th, 2014 at 05:30 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width