Java Reference
In-Depth Information
Sample Run 2:
FIGURE 11-6
Sample Run 2 of the program
ExceptionExample4
Sample Run 3:
1
1
FIGURE 11-7
Sample Run 3 of the program
ExceptionExample4
This program works as follows: The method
main
starts at Line 1. The statement in Line
2 declares the
int
variables
dividend
,
divisor
, and
quotient
. The statement in Line
3 declares the
String
variable
inpStr
. The
try
block starts at Line 4. The statement in
Search WWH ::
Custom Search