Sixth class file structure (read in-depth understanding of JVM virtual machines, as recorded)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.