• Post Reply Bookmark Topic Watch Topic
  • New Topic

Coding for Native methods...  RSS feed

 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any of you give me from where i can find the code for native methods. For ex, hashcode() method. I did unjar all the jar files available under JDK1.3.1_02 directory and find for the files containg the text hashCode(), but i found all are java files ( which means they will not contain the code for native methods). We all know that native methods will be implemented in C language. When i find for the *.c files in JDK1.3.1_02 directory, i got only 'java.c' and 'java_md.c' files which are not cotain hashCode() text itself. May be it is not related to the Exam, but i want to see the code for native methods.
So can you tell me where can i find the code for native methods.
 
Alexan Kahkejian
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Narasimah
Actually you will not find the source code for hashcode(), because these native methods are already compiled and put in .dll files.
Just have a look to the \bin directory of the JRE you will find DLL's of all platform dependent (native) classes like awt.dll , rmi.dll , net.dll ....
I hope this helps.
Alexan
[ May 12, 2003: Message edited by: Alexan Kahkejian ]
 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much, Alexan.
1) Is there any way to get the info from .dll files. Using java decompiler we can decompile the .class file to .java file, similarly is there any way to get the info from .dll files.
2) Can i get the same info(implementation of hashCode() method) from the net.
Thanks in Advance..
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to Java in General (Intermediate) as the topic is not related to the SCJP exam.
Please continue the discussion there. Thanks
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is supposed to provide all of the java and c source for every sun platform release:
http://wwws.sun.com/software/java2/techinfo/README.html
However the download page shows that some of the operating systems are missing. Hope that you can get the one that YOU want.
[ May 12, 2003: Message edited by: Cindy Glass ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!