Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Help Java N Java Native Keyword

Related Tutorials


 
 

Share on Google+Share on Google+

Java Native Keyword

Advertisement
Native is a Java keyword that is used in method declarations to specify that the method will not be implemented in another language, not in Java.

Java Native Keyword

     

Native is a Java keyword that is used in method declarations to specify that the method will not be implemented in another language, not in Java. This keyword signals to the Java compiler that the function is a native language function i.e. its implementation for is written in another programming language because of the native keyword. For example you can write machine-dependent C code and invoke it from Java.

The usual means of write such methods is JNI (Java Native Interface). The Java Native Interface (JNI) comes with the standard Java Development Kit (JDK) from Sun Microsystems. It permits Java programmers to integrate native code (currently C and C++) into their Java applications. The Java Native Interface (JNI) is also known as programming framework, which lets a native method utilize Java objects in the same way that Java code uses these objects. The primary goal of JNI is binary compatibility of native method libraries across all Java virtual machine implementations on a given platform.

  The signature of native method looks like this: 

public native void method();

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: May 25, 2009

Related Tutorials

Discuss: Java Native Keyword   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
RJ
August 22, 2011
Wrong definition?

Hi, The first line should be "Native is a Java keyword that is used in method declarations to specify that the method **will be** implemented in another language, not in Java" and not "Native is a Java keyword that is used in method declarations to specify that the method **will not be** implemented in another language, not in Java".
DMCA.com