Class notes -Java basis of the file access flag

After the end of the constant pool, followed by two bytes represent access flag (access_flag), this flag is used to identify some of the class or interface level access information, comprising: Class This is a class or an interface; if the public is defined as a type; if It is defined as the abstract type; class if so, whether declared final and the like. The meanings of the flag and a flag in the table below:

access_flag in a total of 16 flags can be used, the current definition of the eight, is not used to all the requirements of the flag is 0.

TestClass is an ordinary Java class, not an interface, enum or annotation, the public keyword modified but not declared as final and abstract, and it uses after jdk1.2 compiler to compile, so it's ACC_PUBLIC, ACC_SUPER logo it should be true, but ACC_FINAL, ACC_INTERFACE, ACC_ABSTRACT, ACC_SYNTHETIC, ACC_ANNOTATION, ACC_ENUM six flags should be false, and therefore its value should access_flags is: 0x0001 | 0x0020 = 0x0021.

Guess you like

Origin blog.csdn.net/helianus/article/details/89329881