Hello,
I have a file myClass.java that contains a class like this:
Now, I'd like to load it in the main:
But I got a java.lang.Class NotFoundExcepti on
I'm not used to loadClass but it's strange to me. Any hints?
thanks
I have a file myClass.java that contains a class like this:
Code:
import mylibrary;
public class myClass {
.............................
}
Code:
//main:
try {
Class c = Class.forName( "\\src\\mylibrary\myClass.java" ) ;
Object o = c.newInstance() ;
} catch ( ClassNotFoundException e ) {
e.printStackTrace() ;
}
I'm not used to loadClass but it's strange to me. Any hints?
thanks
Comment