Let's say I have code inside a PLAIN TEXT FILE:
File f = new File("file.txt");
try{
BufferedReader reader = new BufferedReader(new FileReader(f));
String line = reader.readLine();
System.out.println(line);
}catch(IOException e){
e.printStackTrace();
}
Is there a way I can perform that code, and if so, how? i.e. my application would have a method that would read the file, and actually do the code. Is there a way to do this?
The code inside the file is read by my application. I then want to execute this code as if it is a compiled java program.