Describe exception handling in JNI?
Submitted by: AdministratorJNI exceptions can be handled by using C++ exception handling. Using throw and catch blocks of C++ and invoking those methods through JNI is one of the solutions. JNI has built in functions for handling exceptions, which is a better choice.
The following methods can be used for handling exceptions:
throw() : An exception object is thrown. It is used in native method for rethrowing an exception
throwNew() : Creates a new object of an exception and throws it.
exceptionDescribe() : The stack trace and the exception will be printed
exceptionOccurred() : It is used for determining whether an exception is thrown
exceptionClear() : A pending exception will be cleared
fatalError() : A fatal error is raised and does not return anything.
Submitted by: Administrator
The following methods can be used for handling exceptions:
throw() : An exception object is thrown. It is used in native method for rethrowing an exception
throwNew() : Creates a new object of an exception and throws it.
exceptionDescribe() : The stack trace and the exception will be printed
exceptionOccurred() : It is used for determining whether an exception is thrown
exceptionClear() : A pending exception will be cleared
fatalError() : A fatal error is raised and does not return anything.
Submitted by: Administrator
Read Online Java JNI Job Interview Questions And Answers
Top Java JNI Questions
☺ | Describe exception handling in JNI? |
☺ | Advantages and disadvantages of using Java Native Interface (JNI)? |
☺ | Explain Exception Handling in JNI? |
☺ | What is Java Native Interface (JNI)? |
☺ | What is Native Interface in JAVA? |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |