Java Reference
In-Depth Information
Notice how the
default
clause catches invalid choices. For example, if the user enters
3, no
case
constants will match, causing the
default
sequence to execute.
5.
Here is the entire
Help.java
program listing: