Loop Control
- Which of the following is not a valid flow control statement?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
exit() is not a flow control statement in Java. exit() terminates the currently running JVM.
- From where break statement causes an exit?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
The break statement causes an exit from innermost loop or switch.
- What is true about do statement?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Do statement checks the condition at the end of the loop. Hence, code gets executed at least once.
- What is true about a break?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Break halts the execution and forces the control out of the loop.
- The while loop repeats a set of code while the condition is not met?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
While loop repeats a set of code only until the condition is met.