0
It is only a switch statement that a break statement can terminate? Are there other statement that a break statement can also terminate?
2 Antworten
+ 1
break terminates switch stetement if condition becone true
+ 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🙂