Some points here:
1) You don't normally make direct use of ClassLoader, unless you wanna customize the security/access/initialization mechanism of the default class loaders provided.
2) To use java.lang.Class to load a class, simple do this:
try {
Class cls = Class.forName("MyClass");
Object obj = cls.newInstance();
} catch (....) {
}
//There is a long list of possible exceptions here. Check JDK API doc for the list.
2) To use java.lang.Class to load a class, simple do this:
try {
Class cls = Class.forName("MyClass");
Object obj = cls.newInstance();
} catch (....) {
}
//There is a long list of possible exceptions here. Check JDK API doc for the list.
