Java Reference
In-Depth Information
The following steps enter code to call and then execute the getCode() method.
To Enter Code for the getCode() Method
1. Enter line 23 as shown in Figure 4-24 on the previous page into the
main() method of the Commission program.
The statement calls the getCode() method and assigns its return value to a
variable named empCode (Figure 4-25).
method call
FIGURE 4-25
2. Enter lines 53 through 80 as shown in Figure 4-24.
TextPad displays the getCode() method in the coding window (Figure 4-26).
while
statement
getCode()
method
try and catch
statements to
handle exception
caused by input
errors
arguments for
showMessageDialog
method
FIGURE 4-26
 
Search WWH ::




Custom Search