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
keyword. For example you can write machine-dependent C code and invoke it
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:
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: May 25, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles