Skip to content

Figure 2.4 (Welcome3.java)

Wil Simpson edited this page Jul 30, 2021 · 7 revisions

Problem Description

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.

User Documentation

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.

Developer Documentation

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: alt text1

Source Code

Click here to view the source code

Clone this wiki locally