Java Reference
In-Depth Information
1 /*
2
Chapter 2: Welcome to My Day
3
Programmer: J. Starks
4
Date:
October 4, 2007
5
Filename:
Welcome.java
6
Purpose:
This project displays a welcome message, the user's
7
name, and the system date in a console application.
8 */
9
FIGURE 2-17
The code shown in Figure 2-17 includes tab characters , which are entered
by pressing the TA B key and are used to indent items on each line. For example,
in line 2, the tab characters indent the beginning of the line and separate the
words, Chapter 2:, from the words, Welcome to My Day. Line 9 is left blank to
separate the comments visually from the rest of the program code.
Perform the following step to enter comments in the coding window.
To Code Comments
1. With the insertion point in line 1 in the coding window, type the
eight lines of the block comment header as shown in Figure 2-17.
Do not type the line numbers. You can insert your own name as the
programmer. Press the TAB key at the beginning of lines 2 through 7
and after each colon to indent the text as illustrated in Figure 2-17. You
may need to press the TAB key more than once to create the correct
indentation, or press the BACKSPACE key if necessary. Press the ENTER key
after each line. After typing the comment header, press the ENTER key
one more time to create a blank line in line 9.
The code window displays the comment header for the Welcome to My
Day application, as shown in Figure 2-18. The insertion point is displayed
in line 10.
asterisk denotes unsaved
changes to file
block
comment
header
line 9 is blank
insertion point
tab
characters
FIGURE 2-18
 
Search WWH ::




Custom Search