6.2 The cornerstone of independence
Why is the title not the cornerstone of independence? Today, businesses and open source organizations have developed a large number of languages running on Java virtual machines outside the Java language. such as Clojure,groovy,scala and so on.
The Java virtual machine is not bound to any language, including Java, and it is only associated with a specific binary file format such as "Class file." Java programs (*.java)------>javac compilers------> bytecode files----->java virtual machines.
Structure of the 6.3 class file
If you want to know more about virtual machines, then this part is not to be contacted.
Attention?? : Any class file corresponds to the definition information for the only class or interface, but in turn, the class or interface is not necessarily defined in the file (for example, a class or interface can also be generated directly from the ClassLoader).
A class file is a set of binary streams that are based on 8-bit bytes, and each data item is tightly arranged in a class file in a tight order, with no delimiters added in the middle.
The class file uses a pseudo-structure similar to the C language structure to store the data. There are only two types of data: unsigned number and table.
Unsigned number: belongs to the base data type. The u1,u2,u4,u8 represent 1 bytes, 2 bytes, 4 bytes, and 8 bytes of unsigned numbers, respectively. Unsigned numbers can be used to describe: numbers, index references, quantity values, or string values by UTF-8 encoding.
A table is a composite data type consisting of multiple unsigned numbers or other tables. All end With "_info". The entire class file is essentially a single table.
The above is an overview of the basic composition of class files. Follow-up continues with details about which bytes represent what, respectively.
Sixth class file structure (read in-depth understanding of JVM virtual machines, as recorded)