当前位置:网站首页>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 .
边栏推荐
- 【信息检索导论】第二章 词项词典与倒排记录表
- Error in running test pyspark in idea2020
- Sqli-labs customs clearance (less15-less17)
- Two table Association of pyspark in idea2020 (field names are the same)
- MySQL组合索引加不加ID
- 【信息检索导论】第七章搜索系统中的评分计算
- Pyspark build temporary report error
- Explanation of suffix of Oracle EBS standard table
- Use of interrupt()
- php中获取汉字拼音大写首字母
猜你喜欢
使用Matlab实现:Jacobi、Gauss-Seidel迭代
ssm人事管理系统
離線數倉和bi開發的實踐和思考
【信息检索导论】第一章 布尔检索
MapReduce concepts and cases (Shang Silicon Valley Learning Notes)
Oracle EBs and apex integrated login and principle analysis
【信息检索导论】第七章搜索系统中的评分计算
DNS attack details
Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK
【模型蒸馏】TinyBERT: Distilling BERT for Natural Language Understanding
随机推荐
PM2 simple use and daemon
Oracle EBs and apex integrated login and principle analysis
使用 Compose 实现可见 ScrollBar
Ceaspectuss shipping company shipping artificial intelligence products, anytime, anywhere container inspection and reporting to achieve cloud yard, shipping company intelligent digital container contr
ERNIE1.0 与 ERNIE2.0 论文解读
view的绘制机制(二)
Sqli-labs customs clearance (less1)
Practice and thinking of offline data warehouse and Bi development
Oracle general ledger balance table GL for foreign currency bookkeeping_ Balance change (Part 1)
php中树形结构转数组(拉平树结构,保留上下级排序)
CRP implementation methodology
RMAN增量恢复示例(1)-不带未备份的归档日志
架构设计三原则
ssm超市订单管理系统
Alpha Beta Pruning in Adversarial Search
php中判断版本号是否连续
Oracle EBS interface development - quick generation of JSON format data
ssm垃圾分类管理系统
Oracle segment advisor, how to deal with row link row migration, reduce high water level
读《敏捷整洁之道:回归本源》后感