The break and continue statements alter the looping of code.
Without a labelName:
- the break will exit a loop
- the continue will skip the remaining code and continue the loop
while(true)
{
if (number > 10)
break;
}
You can also use a bread and continue with a labelName;
When hit, the program will jump to the labelName;
It is not recommended in structured programming.
restart:
while(true)
{
if (number > 10)
break restart;
}