1 Reply Latest reply: Jul 16, 2011 2:22 PM by 796440 RSS

    SCJP 6: native method hashCode() source code

    875947
      Hello everybody!!
      I am preparing for SCJP 6 ....by Kathy Sierra Book .While studying equals() and hashCode() method i'm confused about the actual implementation algorithm used for
      native hashCode() method . Can anybody please tell me how to figure it-out??
      or
      Is there any way by which I can see the native method source code which I am not able to find in API Documentations.....
        • 1. Re: SCJP 6: native method hashCode() source code
          796440
          Why do you care about it? It won't be on the exam, and it's not part of the spec. Each implementation is free to do it their own way, as long as it meets the hashCode()/equals() contract.

          If you're really curious how the particular JVM that you're using at the moment implements it, the JVM source code--including the native code--is available for download. You may have to do some digging to find it, but I'd start with googling for something like jvm source code download.