Java JNI Question:

Define JNI functions and pointers?

Tweet Share WhatsApp

Answer:

JNI functions are those which are used by the developers to interact with JVM within a native method. Every JNI function receives a special parameter as its first argument – JNIEnv ; which points to a special JNI data structure of the type JNIEnv_ . One of the elements of JNI data structure is a ‘pointer to an array’ generated by JVM, and each element of this array is again a pointer to a JNI function. A JNI function can be invoked from the native method by referencing these pointers. Every JVM provides a unique implementation of the JNI functions.

Download Java JNI PDF Read All 9 Java JNI Questions
Previous QuestionNext Question
Advantages and disadvantages of using Java Native Interface (JNI)?Why does Java have different data types for integers and floating-point values?