Java provides 8 “primitives” types:
byte, short, int,
long, float, double,
char, and boolean.
These are the same as the following C++ typedefs
(which are defined by gcj/cni.h):
jbyte, jshort, jint,
jchar, and jboolean.
You should use the C++ typenames
and not the Java types names
even if they are “the same”.
This is because there is no guarantee that the C++ type
int is a 32-bit type, but jint
is guaranteed to be a 32-bit type.
This is a macro whose argument should be the name of a primitive
The macro expands to a pointer to the Class object
corresponding to the primitive type.
has the same value as the Java expression
Void.TYPE (or void.class).
|Java type||C/C++ typename||Description|
|byte||jbyte||8-bit signed integer|
|short||jshort||16-bit signed integer|
|int||jint||32-bit signed integer|
|long||jlong||64-bit signed integer|
|float||jfloat||32-bit IEEE floating-point number|
|double||jdouble||64-bit IEEE floating-point number|
|char||jchar||16-bit Unicode character|
|boolean||jboolean||logical (Boolean) values|