If
class MyClass {
public static void main(String[] str) {
System.out.println("hello world");
}
}
// in some other file and method
Class klass = Class.forName("MyClass");
How can I call MyClass.main? I do not have the string "MyClass" at compile time, so I cannot simply call MyClass.main(String[]{}).