What is the purpose of the "if-else" statement in Java?
A. To execute one block of code if a condition is true and another block if it's false
B. To declare variables
C. To create loops
D. To define methods
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