Java Reference
In-Depth Information
A
break
without a label causes termination of its immediately enclosing loop or
switch
statement. A
break
with a label causes control to transfer to the end of the
labeled block.
After
break
executes, “after while” is displayed.
Here is the answer:
by a fixed amount. Instead, the loop control variable can change in any arbitrary way.
Using this concept, write a program that uses a
for
loop to generate and display the
progression 1, 2, 4, 8, 16, 32, and so on.