ClassLoader

JVM can be divided into two parts: classloader and execute engine. Classloader takes charge of loading varies class files into JVM, execute engine executes them, and will invoke native method in your system.


ClassLoader Types:

There are two kinds of ClassLoader here: Bootstrap ClassLoader(a part of JVM, written by C++), and CustDef ClassLoader.

Bootstrap ClassLoader loads Java API class files like java.lang.String, CustDef ClassLoader loads class written by programmers. 


Namespace:

If Class A dependends on Class B, then JVM will load Class B using the same ClassLoader that loads Class A.

Different ClassLoader have different namespace, which means the classes loaded by the same class loader are able to each other, otherwise, are not able to. Things like this under default condition. And this is for security consideration.


Parents Delegation Model

A class loader(not Bootstrap ClassLoader) will always make a request to another class loader to load class file, this is Parents Delegation Model. So every class loader has a parent classLoader except Bootstrap ClassLoader.

If all its parent class loaders can't load this class file, then the base class loader itself will load it.


resources: http://www.blogjava.net/zhuxing/archive/2008/08/08/220841.html

     http://www.iteye.com/topic/83978

  http://blog.csdn.net/xw13106209/article/details/7041807

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值