So I made a previous post on how to compile and run a java file But I came to a conclusion of a better idea:- for example I have this java code
public class Main {
public static void main(String[] args){
String test = 123;
Scanner s = new Scanner(System.in);
String code = s.nextLine();
// Code Here
}
So I want the code to work like this if what I type in my String (code) is System.out.println(test + " 123");
it prints out
(123 123)
So what is the code that I should replace in // Code Here
Please make sure that all the variables and libraries in this project are compiled within the code, and please make the answer simple please, the javacompiler class explanation in oracle is kind of hard to comprehend because can you please post an answer in here!