198k views
3 votes
Assume that the following Java statement is contained in the main method of the class named Welcome: System.out.printLine("Welcome!"); What is the name of the file generated by the Java compiler?

1 Answer

3 votes

Answer:

Welcome.class

Step-by-step explanation:

Since this code is contained in a file named Welcome.java. The result of the compilation process is a file of byte code with the same name but with the .class extension. The bytecode (.class file) holds the instructions that the Java Virtual Machine (JVM) knows how to execute.

The summary of compilling and executing a simple program like this is:

javac Welcome.java //compiles the code resulting in the bytecode .class

java Welcome //Executes the instructions in the code

User Darren Parker
by
4.5k points