Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Native Method in java  RSS feed

 
Prakash Rai
Ranch Hand
Posts: 107
Eclipse IDE MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. public final native Class getClass();
2. public native int hashCode();
I have taken these above two method from java.lang package . What is actual use "native"?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15859
80
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that these methods are not implemented in Java itself, but in a platform-specific native library (a DLL if you're running on Windows).

You can use JNI (Java Native Interface) to call non-Java code from a Java program.
 
Prakash Rai
Ranch Hand
Posts: 107
Eclipse IDE MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What platform specific native library.?
Jesper de Jong wrote:It means that these methods are not implemented in Java itself, but in a platform-specific native library (a DLL if you're running on Windows).

You can use JNI (Java Native Interface) to call non-Java code from a Java program.
 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google for open jdk and you can probably find the source code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!