public class Loader extends Object
public class MyClass {
void myMethod() {
...
Class c=Loader.loadClass(this.getClass(),classname);
...
}
| Constructor and Description |
|---|
Loader() |
| Modifier and Type | Method and Description |
|---|---|
static URL |
getResource(String name) |
static ResourceBundle |
getResourceBundle(String name,
boolean checkParents,
Locale locale) |
static Class |
loadClass(Class loaderClass,
String name)
Load a class.
|
static Class |
loadClass(String name)
Load a class.
|
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
MissingResourceExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved