Self-Review Exercises

5.1 Fill in the blanks in each of the following statements:

a) Typically, ________ statements are used for counter-controlled repetition and ________ statements for sentinel-controlled repetition.

b) The do...while statement tests the loop-continuation condition ________ executing the loop’s body; therefore, the body always executes at least once.

c) The ________ statement selects among multiple actions based on the possible values of an integer variable or expression, or a String.

d) The ________ statement, when executed in a repetition statement, skips the remaining statements in the loop body and proceeds with the next iteration of the loop.

e) The ________ operator can be used to ensure that two conditions are both ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.