Compute a Java function's signature

前端 未结 6 1871
傲寒
傲寒 2021-02-03 22:30

Is there a way to compute a Java class\'s method\'s signature? A signature
like ([Ljava/lang/String;)V represents a function that takes a

6条回答
  •  南笙
    南笙 (楼主)
    2021-02-03 22:39

    A quick google search uncovered this webpage:

    http://www.rgagnon.com/javadetails/java-0286.html

    There are two parts to the signature. The first part is enclosed within the parentheses and represents the method's arguments. The second portion follows the closing parenthesis and represents the return type. The mapping between the Java type and C type is

    Type     Chararacter 
    boolean      Z 
    byte         B 
    char         C 
    double       D 
    float        F 
    int          I 
    long         J 
    object       L 
    short        S 
    void         V 
    array        [ 
    

提交回复
热议问题