12. Data Type Mapping
Java primitive data type Native primitive data type Description
void void None
byte jbyte 8-bit signed. Range is -2^7 to 2^7 - 1
int jint 32-bit signed. Range is -2^31 to 2^31 - 1
float jfloat 32 bits. Represent a real number as small as 1.4 x 10-45
and as big as 3.4 x 1038 (approx.), positive or negative
double jdouble 64 bits. Represent a real number as small as 4.9 x 10-324
and as big as 1.7 x 10308 (approx.), positive or negative
char jchar 16-bit unsigned. Range is 0 to 65535
long jlong 64-bit signed. Range -2^63 to 2^63 - 1
short jshort 16-bit signed. Range is -2^15 to 2^15 - 1
boolean jboolean Unsigned 8 bits. true and false
13. Data Type Mapping
Java Reference type JNI type Description
java.lang.object jobject Any Java object
java.lang.String jstring String representation
java.lang.Class jclass Java class object
java.lang.Throwable jthrowable Java throwable object
14. Data Type Mapping
Type Signature Java Type
Z boolean
B byte
C char
S short
I int
J long
F float
D double
V void
[ []
L<packet>/object; object
15. Data Type Mapping
Function in java signature
int foo() “()I”
void foo(byte[] arg) “([B)V”
boolean foo(String arg) “(Ljava/lang/String;)Z”
"(parameterFieldDescriptor)returnFieldDescriptor"