December 1999
Intermediate to advanced
816 pages
20h 27m
English
It is possible to modify the flow of your code from within a loop like a while or for loop by using break or continue. You can use these two keywords with or without a label. You've already seen how to use break to get out of a switch statement, so the example here will show how to use labeled break and continue statements. The break keyword causes the loop to be exited completely. The continue statement causes the loop to be left and started again. That is, break means "exit completely," while continue means "do the next iteration through the loop." Listing 7.2 contains an example.
BigLoop: while(rs.next()!= ... |
Read now
Unlock full access