Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

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.

Ads

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();

 

Advertisements

Ads
Share on Google+Share on Google+

Java Native Keyword

Posted on: May 25, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

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".

Ads

 

Ads