当前位置:网站首页>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 .
边栏推荐
- UEditor . Net version arbitrary file upload vulnerability recurrence
- mapreduce概念和案例(尚硅谷学习笔记)
- 【调参Tricks】WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach
- Pyspark build temporary report error
- 【论文介绍】R-Drop: Regularized Dropout for Neural Networks
- oracle-外币记账时总账余额表gl_balance变化(上)
- Oracle 11g uses ords+pljson to implement JSON_ Table effect
- JSP intelligent community property management system
- ORACLE APEX 21.2安装及一键部署
- RMAN增量恢复示例(1)-不带未备份的归档日志
猜你喜欢

JSP智能小区物业管理系统

Build FRP for intranet penetration

MySQL无order by的排序规则因素

Oracle EBs and apex integrated login and principle analysis

第一个快应用(quickapp)demo

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

Illustration of etcd access in kubernetes

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

Principle analysis of spark

Two table Association of pyspark in idea2020 (field names are the same)
随机推荐
Sqli-labs customs clearance (less18-less20)
Oracle apex 21.2 installation and one click deployment
优化方法:常用数学符号的含义
ssm+mysql实现进销存系统
矩阵的Jordan分解实例
UEditor . Net version arbitrary file upload vulnerability recurrence
读《敏捷整洁之道:回归本源》后感
类加载器及双亲委派机制
@Transational踩坑
如何高效开发一款微信小程序
Explain in detail the process of realizing Chinese text classification by CNN
Practice and thinking of offline data warehouse and Bi development
parser.parse_args 布尔值类型将False解析为True
Yolov5 practice: teach object detection by hand
一个中年程序员学习中国近代史的小结
CSRF攻击
Cloud picture says | distributed transaction management DTM: the little helper behind "buy buy buy"
php中的二维数组去重
Oracle EBs and apex integrated login and principle analysis
解决万恶的open failed: ENOENT (No such file or directory)/(Operation not permitted)