105k views
1 vote
Which JDK command is correct to run a Java application in Registration.class?

1) java Registration
2) java Registration.class
3) javac Registration.java
4) javac Registration

1 Answer

6 votes

Final answer:

The correct command to run a Java application in Registration.class is 'java Registration'. The command 'java' is used to run a Java class, and the class name should not include the '.class' extension.

Step-by-step explanation:

To run a Java application, you would use the Java Runtime Environment command 'java', followed by the name of the class containing the main method, without the '.class' extension. Therefore, the correct JDK command to run a Java application in Registration.class is:

  • 1.Java Registration

When using the 'java' command, you should specify the class name without the '.class' extension. The options that include 'javac' are for compiling Java source files, not running the class files.

User Executifs
by
7.4k points