Java Reference
In-Depth Information
This section of code represents a program stub , which is an incomplete
portion of code entered to allow the developer to compile and test the program.
The stub does not actually implement the details of methods, functions, or other
elements of the code, but serves as a template or placeholder, in which the devel-
oper can later enter code. Using a program stub allows a developer to compile
and test a program incrementally while developing the program, to allow for
debugging and refinement of code.
The following step enters beginning code.
To Enter Beginning Code
1. Enter the code as shown in Figure 4-6 on the previous page, replacing
the programmer name and date shown with your name and the current
date.
The TextPad window displays the code for the program stub (Figure 4-7).
Java source
code file
name
comment
header
import
statements
class
code
main()
method
FIGURE 4-7
Remember that the name of the class must match the name of the Java
source code file exactly. In the code entered in the previous step, the Java source
code file and the class both use the name Commission. The code created a
program stub, which provides the basic template or structure for the code to be
Search WWH ::




Custom Search