In Java, which loop is suitable when you want to execute a block of code a specific number of times?
A. for loop
B. while loop
C. do-while loop
D. switch loop
Answer: Option A
Related Questions on Flow Control
What is the purpose of the "if" statement in Java?
A. To execute a block of code conditionally
B. To create loops
C. To declare variables
D. To define methods
A. No output
B. Error
C. Hello
D. 5
Join The Discussion