publicClass<?>loadClass(String name)throwsClassNotFoundException{returnloadClass(name,false);}// -----??-----protectedClass<?>loadClass(String name,boolean resolve)throwsClassNotFoundException{// 首先,检查是否已经被类加载器加载过Class<?> c =findLoadedClass(name);if(c ==null){try{// 存在父加载器,递归的交由父加载器if(parent !=null){
c = parent.loadClass(name,false);}else{// 直到最上面的Bootstrap类加载器
c =findBootstrapClassOrNull(name);}}catch(ClassNotFoundException e){// ClassNotFoundException thrown if class not found// from the non-null parent class loader}if(c ==null){// If still not found, then invoke findClass in order// to find the class.
c =findClass(name);}}return c;}