-
Notifications
You must be signed in to change notification settings - Fork 0
Figure 2.4 (Welcome3.java)
Create a program that is able to print "Welcome to Java Programming" replacing the spaces with new lines. There must only be one class and only the main method can be used. There is no need for run-time arguments.
When the program is run it starts at the main method in the main class Welcome3 it runs a system call to print the text "Welcome to Java Programming", where each space is instead replaced with a new line, to the console. The program then immediately exits successfully with a code 0. To see the message in console again simply re-run the program.
The main, and only, class Welcome3 has only one method which is the main method. It does not use, check for or require any run-time arguments. The main method only runs the system call to print a message to the console which is "Welcome to Java Programming" where each space is instead replaced with a new line. Then method immediately ends finishing the call to the main method.
UML Diagram:
