title: Passing Primitive data types by reference in JNI
body: <p>I am an embedded C programmer and was integrating my code written in native C/C++ with Java using JNI. I was curios to know whether pass by reference for primitive data_type be possible? I am refering this link <a href="http://java.sun.com/docs/books/jni/html/objtypes.html#5279" rel="nofollow">http://java.sun.com/docs/books/jni/html/objtypes.html#5279</a>  which doesnt help my cause.</p>
  
  <p>Basically what i want to achieve is something like this :
  // Get the val updated by the native call
  int nativeFunc(short val);
  Java Function :</p>
  
  <pre><code>class main
  {
     short val;
     val = 0;
     nativeFunc(val);
     System.out.println(val)
  }
  
  int nativeFunc(short val)
  {
     // Code to update OUt param val
     // Need this portion
  }
  </code></pre>
  
  <p>I dont know if its very trivial question with a very easy answer.</p>