Let's take the following method signature and turn it into a method descriptor:
long f (int n, String s, int[] array);
The method returns a long
, so we describe the fact that it is a method with brackets and that it returns a long
with a uppercase J
.
()J
The first argument is of type int
, so we use an uppercase I
.
(I)J
The next argument is an object, so we use L
to describe it's an object, fully qualify the name and close it with a semi-colon.
(ILString;)J
The last argument is an integer array so we drop in the array syntax followed by int
type:
(ILString;[I)J
and we're done. A JVM method descriptor.