File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Native Method in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Native Method in java" Watch "Native Method in java" New topic
Author

Native Method in java

Prakash Rai
Ranch Hand

Joined: Jan 10, 2011
Posts: 101

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

Joined: Aug 16, 2005
Posts: 13883
    
  10

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Prakash Rai
Ranch Hand

Joined: Jan 10, 2011
Posts: 101

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

Joined: Oct 13, 2005
Posts: 36555
    
  16
Google for open jdk and you can probably find the source code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Native Method in java
 
Similar Threads
Native method
native
how many type or how many kind of way we can create an object in java??
native methods
native modifier