
264 CHAPTER 5 Flow of Control,Part 1: Selection
CHAPTER SUMMARY
DISCUSSION QUESTIONS
1. Explain the purpose of the default case in a switch statement.
2. Explain what happens when you omit a break statement in a case statement.
?
After each execution of the switch statement, the dialog box will reappear,
prompting you for another integer. To test your code, enter each integer
from 0 to 4 into the dialog box, plus some other integer value. To exit the
application, click the Cancel button on the dialog box.
5.13 Chapter Summary
■
Java provides equality, relational, and logical operators to evaluate
a condition, and selection statements to choose which instructions ...