LEARN, PRACTICE & EXCEL!
What is selection in programming? Answer: A control structure that allows branching of
execution paths based on conditions.
Why is selection important in programming? Answer: It allows decision-making, enabling
programs to respond to different inputs and situations.
What is the simplest form of selection in Java? Answer: The if statement.
What is the syntax of an if statement? Answer: if (condition) { statements }
What does an if statement do? Answer: Executes the block if the condition evaluates to true;
otherwise it skips it.
What is the syntax of an if-else statement? Answer: if (condition) { statements } else {
statements }
What does an if-else statement do? Answer: Executes one block if the condition is true, another
if false.
What is a nested if? Answer: An if statement inside another if statement.
When are nested if statements used? Answer: When checking multiple related conditions in
sequence.
What is a multi-way if-else? Answer: An extended chain of if-else conditions to handle multiple
cases.
What is a switch statement? Answer: A multi-way branch that executes code blocks based on a
variable's value.
What types are valid in a switch? Answer: byte, short, int, char, String, enums.
What keyword prevents fall-through in switch? Answer: break.
What is fall-through in a switch? Answer: When multiple cases run because break is missing.
What is the default case in switch? Answer: A block executed if no other cases match.
Is default case required in switch? Answer: No, but it's recommended.
What is a boolean expression? Answer: An expression that evaluates to true or false.
What are relational operators? Answer: ==, !=, <, <=, >, >=
APPHIA – Crafted with Care and Precision for Academic Excellence.
1