Command to execute a compiled java programs is
-
run
-
execute
-
javac
-
java
The java command is used to execute compiled Java programs. javac is the compiler that compiles source code to bytecode, but java runs the compiled bytecode. Commands like run and execute are not standard Java tools. The typical workflow is javac MyClass.java followed by java MyClass.
To execute a compiled Java program, you need to use the java command.
The correct answer is D) java.
Explanation for each option:
Option A) run - This option is incorrect because "run" is not a valid command to execute a compiled Java program.
Option B) execute - This option is incorrect because "execute" is not a valid command to execute a compiled Java program.
Option C) javac - This option is incorrect because "javac" is used to compile Java source code, not to execute a compiled program.
Option D) java - This option is correct because the "java" command is used to execute a compiled Java program. You can run the program by typing java in the command line, where `` is the name of the compiled Java file without the ".class" extension.