Consider the following program, saved into a file named Example.java: What would happen if each of the
Question:
Consider the following program, saved into a file named Example.java:
What would happen if each of the following changes were made to the Example program? For example, would there be no effect, a syntax error, or a different program output? Treat each change independently of the others.
a. Change line 1 to: public class Demonstration
b. Change line 9 to: public static void MAIN(String[] args) {
c. Insert a new line after line 11 that reads:
System.out.println();
d. Change line 2 to: public static void printMessage() {
e. Change line 2 to: public static void showMessage() { and change lines 11 and 12 to: showMessage();
f. Replace lines 3–4 with: System.out.println( " The first rule of Java Club is, " );
Step by Step Answer:
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp