public class Loader extends Object
public class MyClass {
void myMethod() {
...
Class c=Loader.loadClass(this.getClass(),classname);
...
}
| 构造器和说明 |
|---|
Loader() |
public static Class loadClass(String name) throws ClassNotFoundException
Load a class either from the thread context classloader or if none, the system loader
name - the name of the new class to loadClassNotFoundException - if not able to find the classpublic static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException
loadClass, or if none then use loadClass(String)loaderClass - a similar class, belong in the same classloader of the desired
class to loadname - the name of the new class to loadClassNotFoundException - if not able to find the classpublic static ResourceBundle getResourceBundle(String name, boolean checkParents, Locale locale) throws MissingResourceException
Copyright © 2016. All rights reserved.