How to convert Java program into C program?
Convert Java program into C program
It is possible to convert a Java program into a C program, but it is extremely difficult for starters, you would need to follow some step by step:
i. JNI is a Java program that can call the native C code. #include <JavaToC.h> is the header file that provides the Java program to C program mapping and it is easily available in JDK.
ii. #include <JavaToC.h> is the header file generated from the Java source file.
Example:
#include<stdio.h> #include<conio.h> #include<JavaToC.h> JNIEXPORT void JNICALL helloC(JNIEnv *env, jobject javaobj) { printf("Welcome to Webeduclick"); return; }
Output:
Welcome to Webeduclick