The classic old-fashioned process, learning programming language, first learning its most basic data type, as does JNI. JNI defines a series of basic data types and reference data types that correspond to java.
1. Basic Data Types
The following table describes the space occupied by the relationship between the basic data types in Java and the basic data types in JNI.
As you can see, it is actually the basic data type. The basic data type of JNI is only 'J' more than the basic data type of Java.
Of course, there is a jsize not in Java in JNI, which is defined as follows:
Typedef jint jsize;
In fact, the jsize integer is used to describe basic metrics and sizes, and there is no mystery.
2. Reference Data Type
The relationship between the JNI reference type and Java is shown in the following tree Hierarchy Diagram:
Like java, jobject is the father of all reference types. Is it easy to understand? Haha. For jthrowable, JNI also has the thread concept.
3. The jvalue Type
Jvalue is a set of basic and referenced data types. Its definition is as follows:
Typedef union jvalue {
Jboolean z;
Jbyte B;
Jchar c;
Jshort s;
Jint I;
Jlong j;
Jfloat f;
Jdouble d;
Jobject l;
} Jvalue;
This article is from the "Duicky" blog