|
Search this site
|
In our initial JNI example, we declared a Java method that took an int parameter and saw that the resulting C function generated by the javah tool took (along with a couple of other parameters) a parameter of type jint. In fact, the Java method also returned an int, and the corresponding C method a jint. Here are the two side by side as a reminder:
From this example, you'll hopefully be unsurprised to learn that for each Java primitive type, there is a corresponding C type declared in the JNI headers. So a Java boolean becomes a C jboolean, a Java char a C jchar etc:
Written by Neil Coffey. Copyright © Javamex UK 2009. All rights reserved. |