File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Native Method in java

 
Prakash Rai
Ranch Hand
Posts: 106
Eclipse IDE MyEclipse IDE
  • 0
  • 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
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • 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: 106
Eclipse IDE MyEclipse IDE
  • 0
  • 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
Pie
Posts: 47262
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google for open jdk and you can probably find the source code.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic