Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public class MainClass {
public static void main(String[] args){
ClassLoader classLoader = MainClass.class.getClassLoader();
try {
Class aClass = classLoader.loadClass("com.jenkov.MyClass");
System.out.println("aClass.getName() = " + aClass.getName());
} catch (ClassNotFoundException e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment