ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

JNI数据类型

2026/9/29 6:23:07 拓冰建站 浏览量
JNI数据类型
JNI基础类型对照表
Java类新本地类型说明
booleanjbooleanunsigned  8 bits 
bytejbytesigned  8 bits 
charjcharunsigned 16 bits 
shortjshortsigned 16 bits 
intjintsigned 32 bits 
longjlongsigned 64 bits 
floatjfloat32 bits 
doublejdouble64 bits 
voidvoidvoid 
JNI引用数据类型对照表
Java类型本地类新Java类新本地类型
All objectsjobjectchar[]jcharArray
java.lang.Class instancesjclassshort[]jshortArray
java.langd.String instances

jstring

int[]jintArray
arraysjarraylong[]jlongArray
object[]jobjectArrayfloat[]jfloatArray
boolean[]jbooleanArraydouble[]jdoubleArrray
byte[]jbyteArrayjava.lang.Throwable objectsjthrowable

类型签名(Type Signature)
Java Type Type Signature Java  Type Type Signature
booleanZfloatF
byteBdoubleD
charCfully-qualified-classL fully-qualified-class
shortStype[][type
intImethod type(arg-types)ret-type
longJ

比如Java一个方法: 

long  aMethod( int n, String  s ,int[]  arr) ;

那么可以表示为: 

(ILJava/lang/String;[I]J 

其中括号表示函数方法参数,尾部是返回值。