Public long aaaa(){
}
public int aaaa(){
}
Next, let's explain what the exception information provided by JVM means when the program has a NoSuchMethodException. First, let's look at several methods and their method signatures:
Public void test1() {} test1() v.
public void test2(String str)test2(Ljava/lang/String; )V
public int test3(){} test3()I
From the above three examples, we can easily see some small laws:
The method signature provided by JVM actually consists of three parts: the method name (the above example did not write the complete class name for simplicity), the parameter table and the return value. The basic form is:
The full class name. Method name (list of formal parameter data types) returns the data type.
After we know the structure of the method signature provided by the JVM, this is not enough, because the JVM does not specifically write the data type, but provides a special representation. The following table shows the relationship between special presentation characters and letters and the corresponding data types:
Special Character/Letter Meaning in Java Method Signature
Special description of special character data types
Vvoid is usually used to represent the return value of a method.
Zboolean
Bbyte
Cahal
short
Iint
Jinlong
Ffloat
double
[Arrays begin with [,and cooperate with other special characters to represent arrays of corresponding data types, and several [arrays representing several dimensions.
L complete class name; The reference type starts with l,; Finally, in the middle is the full class name of the reference type.