June 2018
Beginner
722 pages
18h 47m
English
The continue statement supports functionality similar to the one supported by the break statement. But instead of exiting the loop, it forces exiting the current iteration only, so the loop continues executing. To demonstrate how it works, let's assume that, as in the case with the break statement in the previous section, we need to search a three-dimensional array and find the array of the lowest dimension that has the sum of its elements equal to or bigger than 4. But this time, the sum should not include an element equal to 1. Here is the array:
int[][][] data = { {{1,1,2},{0,3,0},{2,4,1},{2,3,2}}, {{0,2,0},{1,3,4},{2,0,1},{2,2,2}}};
Our program should find the following arrays:
Read now
Unlock full access