0x0021 = 0x0020|0x0001,即ACC_PUBLIC和ACC_SUPER为真,ACC_PUBLIC好理解,ACC_SUPER这是什么鬼,翻看官方文档,原文如下:
The ACC_SUPER flag indicates which of two alternative semantics is to be expressed by the invokespecial instruction (§invokespecial) if it appears in this class. Compilers to the instruction set of the Java Virtual Machine should set the ACC_SUPER flag.
The ACC_SUPER flag exists for backward compatibility with code compiled by older compilers for the Java programming language. In Oracle’s JDK prior to release 1.0.2, the compiler generated ClassFile access_flags in which the flag now representing ACC_SUPER had no assigned meaning, and Oracle's Java Virtual Machine implementation ignored the flag if it was set.
为了兼容之前的jdk版本,在jdk1.0.2之后这个编译出来的为真
5,类索引,父类索引,接口索引
接下来就是类索引,父类索引,接口索引
00 05------类索引值为#5
#5 = Class #21 // Test
00 06-----父类索引值为#6
#6 = Class #22 // java/lang/Object
00 00----类没有实现接口,接口数为0,所以后面没有接口信息
6、字段
00 00----当前类有0个字段
7、方法,指令
00 02----当前类有两个方法,参照官方文档,方法的结构如下:
method_info { u2 access_flags; u2 name_index; u2 descriptor_index; u2 attributes_count; attribute_info attributes[attributes_count]; }
方法1:00 01 00 07 00 08 00 01
----00 01:access_flags=0x0001=ACC_PUBLIC,方法的访问标志如下表: