0

It is only a switch statement that a break statement can terminate? Are there other statement that a break statement can also terminate?

10th Oct 2016, 2:07 PM
ibiso bien
ibiso bien - avatar
2 Antworten
+ 1
break terminates switch stetement if condition becone true
10th Oct 2016, 2:31 PM
Abdullah Rafiq
Abdullah Rafiq - avatar
+ 1
break; is used to prematurely exit out of a loop. They are pretty much mandatory in switch statements as to ensure that not all cases are run, but you can also used them in for loops, while loops, and do/while loops🙂
10th Oct 2016, 2:42 PM
Cohen Creber
Cohen Creber - avatar