問題文
Two loops are nested. When a matching element is found in the inner loop, the program must stop searching entirely and continue with the code that follows the outer loop. Which mechanism does that with a single statement?
選択肢
- A break statement with no label at all, which ends both loops and then resumes where an outer loop has just ended.
- A break statement that names a label placed on the outer loop, so control resumes after that loop.
- A continue statement that names a label placed on the outer loop, which skips the remaining iterations of both loops and moves past them.
- A return statement, which is the only way to leave more than one level of loop and is therefore required whenever loops are nested inside one another.