viking_zp wrote:
Class cls1 = cl.loadClass("test.loading.LoadingClass");
console.getOut().println("Loaded: " + cls1);
Loaded l = (Loaded) cls1.newInstance();
l.getAnswer();
...
But I have exception:
java.lang.ClassCastException: test.loading.LoadingClass cannot be cast to test.loading.Loaded
Please replace the line
Class cls1 = cl.loadClass("test.loading.LoadingClass"); with the following line:
Class cls = cl.loadClass("test.loading.Loaded");