And look back on the 15th day of Java

Source: Internet
Author: User

Loading of classes

When the program actively uses a class is, if the class has not been loaded into memory, the system will be loaded, linked, initialized three steps to initialize the class, if there is no accident, the JVM will complete the three steps, so it is sometimes referred to the three steps of the class loading and initialization of the class.

A class is loaded by reading the class file into memory and creating a Java.lang.Class object for it, which means that when any class is used in the program, a Java.lang.Class object is created for it

Class loading is done by the ClassLoader of the class, which is typically providedby the JVM , which is the basis for the program to run, and the loader that theJVM provides is called the system loader, and in addition, developers can inherit Class Loader base class to create your own loader

With different loaders, binary data can be loaded from different sources

    • Loading the class file locally
    • Load a class file from the JAR Package
    • Load class files over the network
    • dynamically compile and load a Java source file

The class loader does not have to wait until the class is first used to load, and the Java Virtual machine specification allows some classes to be preloaded

And look back on the 15th day of Java

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.