When I observe my Java project byte code, I see the following byte code :
java.lang.Object.()V
java.lang.Boolean.(Z)V
What is the meaning of <init>()V and <init>(Z)V
When I observe my Java project byte code, I see the following byte code :
java.lang.Object.()V
java.lang.Boolean.(Z)V
What is the meaning of <init>()V and <init>(Z)V
It's all method signatures in bytecode used by JVM.
<init>()V and <init>(Z)V
are construtor signatures. For JVM constructors are just as any other methods, they have a name, which is always<init>
), and a return value, which is alwaysV
(means void). In our caseZ
meansboolean
parameter (B
is reserved forbyte
)that is
in class Test's bytecode means
you can also meet
which means static initialization block
is a void method (
V
) onjava.lang.Object
that takes no arguments.is a void method on
java.lang.Boolean
that takes a singleboolean
(Z
sinceB
isbyte
) argument.In short,
See JNI Type Signatures for more detail.