Flow Control - Study Mode

[#1] In Java, what is the purpose of the "if-else if-else" statement?
Correct Answer

(C) To evaluate multiple conditions and execute the corresponding block of code

[#2] In Java, which loop is used when you want to execute a block of code at least once?
Correct Answer

(C) do-while loop

[#3] What does the "else" statement in an "if-else" statement block indicate?
Correct Answer

(D) The block of code to execute if the condition is false

[#4] In Java, what does the "continue" statement do in a loop?
Correct Answer

(A) Skips the current iteration of a loop and continues to the next

[#5] What is the purpose of the "break" statement in a "switch" statement?
Correct Answer

(D) Exits the switch statement prematurely