About Question com.enthuware.jfcja.v8.2.275 :
Posted: Fri Apr 30, 2021 9:39 am
I don't understand why the first option isn't correct :
- break without a label, can occur only in a switch, while, do, or for statement.
even the explanation says :
A break statement with no label attempts to transfer control to the innermost enclosing switch, while, do, or for statement; this statement, which is called the break target, then immediately completes normally. If no switch, while, do, or for statement encloses the break statement, a compile-time error occurs.
- break without a label, can occur only in a switch, while, do, or for statement.
even the explanation says :
A break statement with no label attempts to transfer control to the innermost enclosing switch, while, do, or for statement; this statement, which is called the break target, then immediately completes normally. If no switch, while, do, or for statement encloses the break statement, a compile-time error occurs.