2020-01-15 Java 中Run-time Built-in Class Loaders

本文详细介绍了Java运行时的三个内置类加载器:引导类加载器、平台类加载器和系统类加载器,解释了它们之间的关系及各自负责加载的类。平台类加载器用于加载平台类,包括Java SE API及其实现。系统类加载器,也称应用类加载器,用于定义应用程序类路径上的类。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Run-time Built-in Class Loaders

The Java run-time has the following built-in class loaders:

1. Bootstrap class loader. 

It is the virtual machine's built-in class loader, typically represented as null, and does not have a parent.

2. Platform class loader

All platform classes are visible to the platform class loader that can be used as the parent of a ClassLoader instance. Platform classes include Java SE platform APIs, their implementation classes and JDK-specific run-time classes that are defined by the platform class loader or its ancestors.

To allow for upgrading/overriding of modules defined to the platform class loader, and where upgraded modules read modules defined to class loaders other than the platform class loader and its ancestors, then the platform class loader may have to delegate to other class loaders, the application class loader for example. In other words, classes in named modules defined to class loaders other than the platform class loader and its ancestors may be visible to the platform class loader.

3. System class loader

It is also known as application class loader and is distinct from the platform class loader. The system class loader is typically used to define classes on the application class path, module path, and JDK-specific tools. The platform class loader is a parent or an ancestor of the system class loader that all platform classes are visible to it.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值