Termination of the loop and the program

(Display Listing 2.)

When the value of testResult is found to be false:

When the code in the doTogether block finishes execution, the program terminates.

(In general, the loop will exit or terminate when the conditional clause evaluates to false.)