当前位置:网站首页>Classloader and parental delegation mechanism
Classloader and parental delegation mechanism
2022-07-02 07:18:00 【Software development heart】
One 、 Class loader model
There is a class Car, Created 3 An example :
Print 3 individual car class hashcode, The address is different (356573597,1735600054,
21685669); But through this, this 3 An example , Get the original class , The address is the same (1956725890), Explain this 3 All classes come from the same template .
Two 、 Parent delegate mechanism
Let's talk about the class loader type first , Altogether 4 Kind of :
1. Virtual machine loader
2. Start class ( root ) loader
3. Extend the classloader
4. Applications ( System class ) loader

To build a java.lang Under the same name String Method , Print test , Tips main No way to find 
This is java A mechanism to ensure security ,java Runtime , Find the class loader in the following order :
1. Class loader received class load request
2. Delegate this class loading request upward to the parent class loader to complete , All the way up , Until you start the class loader
3. Start the class loader to check whether the current class can be loaded , If you can load it, it's over , Use current loader ; otherwise , Throw an exception , Notify the subclass loader to load
4. Repeat step 3
5. All loaders failed to load , Throw an exception :Class Not Found
What we found this time is jre\lib\rt.jar Under the bag java.lang.String.toString() Method execution , This method is not main Methodical , So wrong reporting , In this way, the programmer can avoid misoperation and modification java Standard package for , Ensure the security of the system .
边栏推荐
- Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
- oracle EBS标准表的后缀解释说明
- Module not found: Error: Can't resolve './$$_ gendir/app/app. module. ngfactory'
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- PM2 simple use and daemon
- CAD二次开发 对象
- 使用Matlab实现:Jacobi、Gauss-Seidel迭代
- Yaml file of ingress controller 0.47.0
- Sqli-labs customs clearance (less18-less20)
- ORACLE EBS DATAGUARD 搭建
猜你喜欢

【模型蒸馏】TinyBERT: Distilling BERT for Natural Language Understanding

【Ranking】Pre-trained Language Model based Ranking in Baidu Search

ssm+mysql实现进销存系统

Three principles of architecture design

MySQL无order by的排序规则因素

ORACLE EBS ADI 开发步骤

ssm垃圾分类管理系统

SQL injection closure judgment

中年人的认知科普

Basic knowledge of software testing
随机推荐
Use of interrupt()
view的绘制机制(三)
Sqli labs customs clearance summary-page1
Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
架构设计三原则
Principle analysis of spark
oracle EBS标准表的后缀解释说明
sparksql数据倾斜那些事儿
矩阵的Jordan分解实例
SSM学生成绩信息管理系统
Oracle EBS interface development - quick generation of JSON format data
UEditor . Net version arbitrary file upload vulnerability recurrence
A summary of a middle-aged programmer's study of modern Chinese history
mapreduce概念和案例(尚硅谷学习笔记)
软件开发模式之敏捷开发(scrum)
使用 Compose 实现可见 ScrollBar
【论文介绍】R-Drop: Regularized Dropout for Neural Networks
Sqli-labs customs clearance (less15-less17)
Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK