The command to compile java program (Main.java) using JDK
Answers
Answered by
0
Answer:
Compiling and running a java program is very easy after JDK installation. Following are the steps −
Open a command prompt window and go to the directory where you saved the java program (MyFirstJavaProgram.java). Assume it's C:\.
Type 'javac MyFirstJavaProgram.java' and press enter to compile your code. If there are no errors in your code, the command prompt will take you to the next line (Assumption: The path variable is set).
Now, type ' java MyFirstJavaProgram ' to run your program.
You will be able to see the result printed on the window.
Similar questions
Computer Science,
2 months ago
Math,
2 months ago
World Languages,
2 months ago
Math,
4 months ago
History,
10 months ago
Sociology,
10 months ago