Advantages and disadvantages of using JNI

Explain the advantages and disadvantages of using JNI.

Advantages of JNI :

- Using JNI, we can access C and C++ code which adds performance boost to JAVA.

- JNI allows JAVA to access some hardware features using other languages like C and C++.

Disadvantages of JNI :

- JNI uses native languages which mean it has portability issue.

- Code debug is big problem for the developers who use JNI features in JAVA.

Explain the advantages and disadvantages of using JNI.

Advantages :

- Use the existing library that was previously written in another languages.

- Use of Windows API functions.

- Increasing the speed of execution.

- Invoke API functions from server product that is developed in C or C++ from a Java client.

Disadvantages :

- Write Once Run Anywhere is not possible.

- Run time errors debugging is difficult in native code.

- An applet can not call a native method.

- Security risk is potential.
Explain Exception Handling in JNI
JNI exceptions are handled by using the following: Throw( ) Throws an existing exception object. Used in native methods to rethrow an exception..
What is JNI?
JNI stands for Java Native Interface...
Define JNI functions and pointers
JNI functions are those which are used by the developers to interact with JVM within a native method....
Post your comment