????3??????JVM????????????????????ж?????class??????????
????JVM???ж?????class???????????????ж???????????????????????ж????????????????????????????????????????????£?JVM???????????class??????????????class??????class???????????????????ClassLoader??????????JVM???????????????????class????????????????Java??org.classloader.simple.NetClassLoaderSimple??javac???????????????????NetClassLoaderSimple.class??ClassLoaderA??ClassLoaderB????????????????????NetClassLoaderSimple.class???????????????java.lang.Class?????????????????JVM??????????????????????????????????????????????????????????????Class??????????????????????????????????java.lang.ClassCaseException??????????????????????????????????????????????????????????
????1??????web????????????org.classloader.simple.NetClassLoaderSimple.java??
????package org.classloader.simple;
????public class NetClassLoaderSimple{
????private NetClassLoaderSimple instance;
????public void setNetClassLoaderSimple(Object obj){
????this.instance=(NetClassLoaderSimple)obj;
????}
????}
????org.classloader.simple.NetClassLoaderSimple???setNetClassLoaderSimple???????????Object???????????????????????org.classloader.simple.NetClassLoaderSimple?????
????2????????????class????????NetWorkClassLoader.java??
????package classloader;
????public class NewworkClassLoaderTest{
????public static void main(String[]args){
????try{
????//????????????е?class???
????String rootUrl="http://localhost:8080/httpweb/classes";
????String className="org.classloader.simple.NetClassLoaderSimple";
????NetworkClassLoader ncl1=new NetworkClassLoader(rootUrl);
????NetworkClassLoader ncl2=new NetworkClassLoader(rootUrl);
????Class<?>clazz1=ncl1.loadClass(className);
????Class<?>clazz2=ncl2.loadClass(className);
????Object obj1=clazz1.newInstance();
????Object obj2=clazz2.newInstance();
????clazz1.getMethod("setNetClassLoaderSimple"??Object.class).invoke(obj1??obj2);
????}catch(Exception e){
????e.printStackTrace();
????}
????}
????}
???????????????????class??????????????????????????????????NetworkClassLoader??????????????????????????????????class?????????????ClassLoader?????????????Class???clazz1??clazz2??????????Class?????????????????????obj1??obj2??????????????clazz1?е?setNetClassLoaderSimple??????
????3????????????

??????????????п?????????????????class????????????????????????????ClassLoader??????????????JVM????????????????????
????4??ClassLoader??????????

???????ClassLoader???????????
????????1?????ClassLoader????ν???????????δ???
????ClassLoader loader=ClassLoaderTest.class.getClassLoader();//??ü???ClassLoaderTest.class?????????????
????while(loader!=null){
????System.out.println(loader);
????loader=loader.getParent();//?????????????????
????}
????System.out.println(loader);
????????????

????????н???????ClassLoaderTest???????????AppClassLoader??
????????н???????AppClassLoader?????????ExtClassLoader????parent=ExtClassLoader??
?????????н???????ExtClassLoader?????????Bootstrap ClassLoader?????Bootstrap ClassLoader????????????Java??????ExtClassLoader??parent=null??????????е???????null????????