Structure of class file
There are two structures in Java's class file: unsigned numbers and tables. The smallest storage unit is 8 bytes.
Unsigned numbers are the basic data types used to describe numbers, UTF-8 encoded strings, and index references.
Represents a complex data structure that consists of multiple unsigned numbers.
which
- Magic is the magic number, and the magic number takes up 4 bytes, what is the magic number to do? It actually means that the type of the file is a class file, not a JPG image, or an AVI movie. The magic number corresponding to the class file is 0xCAFEBABE.
- Minor_version represents the minor version number of the class file.
- Major_version represents the major version number of the class file.
- CONSTANT_POOL constant pools primarily store literal and symbolic references. Where the literal contains the static string, the static final constant, and so on. A symbol reference contains the fully qualified name of a class or interface, the names and descriptors of fields and methods, and so on.
There are also various descriptive classes of information, such as: the implementation of the interface list, superclass, method list, attribute list and so on.
To some extent, the information stored in the class file is loaded, most of it is stored in the method area.
Deep understanding of Java Virtual Machine virtual machine execution subsystem