How to call a method from loaded class using classLoader?
This is the code I use :
File urlclasspath = new
File("C:/Users/ASUS/Desktop/semantics/semantics/bin");
URL urlarray[] = new URL[1];
urlarray[0] = urlclasspath.toURI().toURL();
MyClassLoader mycl = new MyClassLoader(urlarray);
Class myclass = mycl.loadClass("USAGE");
Object obj = myclass.newInstance();
And the class I'm loading is USAGE and the method I want to call is
main(String[] args)
No comments:
Post a Comment