当前位置:网站首页>双亲委派机制
双亲委派机制
2022-07-24 16:35:00 【isTrueLoveColour】
java虚拟机对class文件采用的是按需加载的方式,也就是说只有在需要使用这个类时,才会将它的class文件加载到内存生成class对象,加载类文件时采用的双亲委派模式,也就是把请求交给父类处理,也就是说,
- 如果一个类加载器收到了类加载的请求,并不会自己先去加载,而是把这个请求委托给父类的加载器去执行
- 如果父类的加载器还存在其父类的加载器,就会进一步向上委托,直到达到最顶层的引导类加载器
- 如果父类加载器可以完成加载任务,就会直接返回,只有父类加载器不能完后任务时,子类加载器才回去尝试加载,这也就是双亲委派模式
这样就可以避免类的重复加载;并且保护程序安全,防止核心api被篡改
例如你可以自定义一个Object类,但是你无法使用它
边栏推荐
- What is the difference between cookies, localstorage and sessionstorage?
- Zcmu--5023: family division (C language)
- .NET 测试框架 xUnit,MSTest, Specflow 使用经验汇总
- Creation and inheritance of JS class
- Hping3 installation and use
- EF LINQ Miscellany
- File browser? QT can also be achieved!
- [leetcode]38. counting - problem solving (execution time beat 91%, memory consumption beat 97%)
- 2019q1 global smartphone shipments: Huawei vivo increased significantly, while Apple plummeted 30.2%!
- C font usage effect
猜你喜欢

15、ARM嵌入式系统:如何用PC调试单板

TCP协议调试工具TcpEngine V1.3.0使用教程

1184. Distance between bus stops

Custom view - Custom button

.NET 测试框架 xUnit,MSTest, Specflow 使用经验汇总

Why should we launch getaverse?

剑指 Offer 48. 最长不含重复字符的子字符串

EventLoop event loop mechanism

多线程(基础)

Summary of experience in using.Net test framework xUnit, mstest, specflow
随机推荐
Jenkins cli command details
Dongfang Guangyi refuted the rumor late at night, saying that the news that the hammer was filed for investigation was untrue!
QT keyboard event (I) -- detect key input
Codeworks round 693 (Div. 3) C. long jumps problem solution
js,for循环内callback异步转换成同步执行
MODIS 16 day data monthly / quarterly synthesis
GEO satellite data download
期盼已久全平台支持-开源IM项目OpenIM之uniapp更新
The 3D sensing market is accelerating. Who will be better, TOF or structured light?
leetcode:162. 寻找峰值【二分寻找峰值】
Summary of experience in using.Net test framework xUnit, mstest, specflow
Qt键盘事件(二)——长按按键反复触发event事件问题解决
QT design simulation robot controller
Software recommendation - Installation
Jing Wei PS tutorial: basic part a
Intel plans to sell baseband chip business, but Apple has given up?
Explain Apache Hudi schema evolution in detail
Software - prerequisite software
Servlet framework (servlet+jsp) + addition, deletion, modification and query + paging implemented by MySQL (function package student information entry, addition, deletion, modification and query of st
Qt键盘事件(一)——检测按键输入