Problem statement:
Both the classes ExecutionThree and ExecutionFour are saved in ExecutionThree.java
For example:-
If we are running this program in any of the IDE(Integrated Development Environment) without terminal then the IDE will print the output as ExecutionThree
If we are running this program using terminal even in the IDE's terminal, then we must use java tool command.
For it below are the steps:
step-1: javac FileName.java
javac ExecutionThree.java
step-2: java ClassName
java ExecutionThree
step-3: output - ExecutionThree
step-4: java ExecutionFour
step-5: output - ExecutionFour
Both the classes ExecutionThree and ExecutionFour are saved in ExecutionThree.java
- public class ExecutionThree {
- public static void main(String[] args) {
- System.out.println("ExecutionThree");
- }
- }
- class ExecutionFour{
- public static void main(String[] args) {
- System.out.println("ExecutionFour");
- }
- }
Output:
Output will depend on how we want to run the class. For example:-
If we are running this program in any of the IDE(Integrated Development Environment) without terminal then the IDE will print the output as ExecutionThree
If we are running this program using terminal even in the IDE's terminal, then we must use java tool command.
For it below are the steps:
step-1: javac FileName.java
javac ExecutionThree.java
step-2: java ClassName
java ExecutionThree
step-3: output - ExecutionThree
step-4: java ExecutionFour
step-5: output - ExecutionFour
No comments:
Post a Comment