Java class loading process, java class loading

Source: Internet
Author: User

Java class loading process, java class loading

1. Load. Load the. class file to the memory.
2. Create a Class and create the corresponding java. lang. Class Object (the java. lang. Class Object is used to encapsulate the data structure of the Class in the method area)
3. Verify and check whether the. class file complies with the. class File Specification.
4. Prepare, allocate memory for static variables, and assign the default value (for example, static int I = 5, at this time I is assigned 0)
5. Connect to convert a symbolic reference (the description of the reference relationship in the. class file) to a direct reference (real memory address reference)
6. initialize the static variable, assign the initial value to the static variable (for example, static int I = 5. At this time, I is assigned a value of 5), and execute the static code block.

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.