Java class loading process

Source: Internet
Author: User

I. Class Loader

1. Root loader, written by bootstrap,c++;

2. Extension class loader, Java writing;

3. System, Application class loader, Java writing;

4. User-defined class loader, Java.lang.ClassLoader subclass, user can customize the loading mode of the class;

Two. How classes are loaded
1. Directly loaded in the locally compiled class
2. Network load: Java.net.URLClassLoader can load the class specified by the URL
3. Load class from jar, zip and so on, automatically parse jar file to find class file to load Util class
4. Dynamically compile from Java source code file into class file

Parental delegation Model

When a class receives a load request from the ClassLoader, it first delegates the load task to the parent ClassLoader, recursively, if the parent ClassLoader is able to complete the load task, returns successfully if the parent ClassLoader cannot load and takes the load itself.

Java class loading process

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.