title: JNI: calling C from java
body: <p>I am writing a C implementation for Java Code and it is a simple HelloWorld code.</p>
  
  <pre><code>#include &lt;jni.h&gt;
  #include &lt;stdio.h&gt;
  #include "HelloJNI.h"
  
  // Implementation of native method sayHello() of HelloJNI class
  JNIEXPORT void JNICALL Java_HelloJNI_sayHello(JNIEnv *env, jobject thisObj) {
     printf("Hello World!\n");
     return;
  }
  </code></pre>
  
  <p>But I would like to call another function in this function called callmethod:</p>
  
  <pre><code>int callmethod(JNIENV *env, jint a, jint b)
  {
     return a+b;
  }
  </code></pre>
  
  <p>Is there any way to call <code>int callmethod(JNIENV *env, jint a, jint b)</code> which is not declared java code to be called in the method <code>JNIEXPORT void JNICALL Java_HelloJNI_sayHello(JNIEnv *env, jobject thisObj)</code>?</p>