What are Native methods in Java?Java applications can call code written in C, C++, or assembler. This is sometimes done for performance and sometimes to access the underlying host operating system or GUI API using the JNI.
The steps for doing that are:
1. First write the Java code and compile it 2. Then create a C header file 3. Create C stubs file 4. Write the C code 5. Create shared code library (or DLL) 6. Run applicationWhat are Native methods in Java?It is possible to execute C or C++ code by a Java application. This process is done by taking certain performance issues and access to the underlying host operating systems into consideration. To execute these programs, Java Native Interface framework is used.
|