I would like to know if there is a posibility to instance a class of an external file
For example: Oreja oreja_object = getClassFromExternalFile("C:\oreja_file.java");
Thanks, Cristina.
I would like to know if there is a posibility to instance a class of an external file
For example: Oreja oreja_object = getClassFromExternalFile("C:\oreja_file.java");
Thanks, Cristina.
Cristina, you can load external .class
files dynamically using a custom ClassLoader
, such as URLClassLoader
. Have a look at this question.
You cannot load a .java
source file directly. It must be compiled first, for example using the Java Compiler API.