JVM virtual machine --- (8) access to the file structure of the Class logo

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq1021979964/article/details/97128696

 

At the end of the constant pool, followed by two bytes represent access flag (access_flags), this flag is used to identify some of the class or interface level access information, comprising: Class This is a class or an interface. Whether defined as a public type, whether defined as an abstract type. If that kind of thing, whether declared as final and so on. The meanings of the flag and flag below

access_flags in a total of 16 Flag can be used only defines the current eight, the flag is not used shall be zero.

Case

public class TestConstant {

    private final int a = 10;
    private final int b = 10;
    private int c = 11;
    private int d = 11;
    private long e = -11111110005514L;
    private long f = -11111110005514L;
    private double g = 10.4557848D;
    private double h = 10.4557848D;
    private String y = "JVM";
    private String j = "JVM";

}

After compiled into class files, using UltraEdit open, it can be compiled Java bytecode

 

Access_flags value = 0021 Release Accordingly, 0x0001 + 0x0020 = 0x0021,

It ACC_PUBLIC, ACC_SUPER flag should be true. The rest is false.

Verify correct.

 

 

Guess you like

Origin blog.csdn.net/qq1021979964/article/details/97128696