zoukankan      html  css  js  c++  java
  • JNI field descriptor

    JNI field descriptor "([Ljava/lang/String;) V"

     

    "([Ljava/lang/String;) V" It is a coding of the return value and parameters of the function. This encoding is called JNI Field Descriptors (JavaNative Interface Field Descriptors). An array of int [] needs to be expressed as "[I". If multiple arrays double [] [] [] need to be expressed as "[[[D". In other words, the beginning of each square bracket means an array dimension. Behind multiple boxes is the type of array.

    If the descriptor starts with an L, it is the class descriptor, which is followed by the string of the class, and then the semicolon ";" ends.

    For example, "Ljava/lang/String;" means the type String;

    "[I" means int [];

    "[Ljava/lang/Object;" means Object [].

    The JNI method descriptor is mainly to put the parameters in parentheses and the return type after the parentheses, as follows:

    (Parameter descriptor) return type

    When a function does not need to return the parameter type, it is represented by "V".

    For example, "() Ljava/lang/String;" means String f ();

    "(ILjava/lang/Class;) J" means long f (int i, Class c);

    "([B) V" means void String (byte [] bytes);

    Java typessymbol
    Boolean Z
    Byte B
    Char C
    Short S
    Int I
    Long J
    Float F
    Double D
    Void V
    objects Start with "L" and end with ";", in the middle are the package and class names separated by "/". For example: Ljava/lang/String; if it is a nested class, use To Table shows the insert sleeve Example The"(Ljava/lang/String;Landroid/os/FileUtilFileStatus;) Z "

    In addition, the abbreviation of the array type can be expressed by "[" plus the short form of the corresponding type shown in Table A,

    For example: [I means int []; [L/java/lang/objects; means Objects [], in addition. Reference types (except for arrays of basic types) have a ";" at the end

    E.g:

    "() V" means void Func ();

    "(II) V" means void Func (int, int);

    "(Ljava/lang/String; Ljava/lang/String;) I". Means int Func (String, String)

  • 相关阅读:
    2017 ACM-ICPC 亚洲区(南宁赛区)网络赛 (B,F,L,M)
    Coderfroces 862 C. Mahmoud and Ehab and the xor
    [CQOI 2015] 任务查询系统
    [POI 2014] Couriers
    [POJ 2104] K-th Number
    [模板] 可持久化数组
    [AHOI 2006] 上学路线
    [SCOI2009] 生日礼物
    [BZOJ 3436] 小K的农场
    [USACO2007 Demo] Cow Acrobats
  • 原文地址:https://www.cnblogs.com/justinzhang/p/15743217.html
Copyright © 2011-2022 走看看