Multiple Choice
Consider the following outline of a nested if-else structure which has more if clauses than else clauses. Which of the statements below is true regarding this structure? if (condition1)
If (condition2)
Statement1;
Else
Statement2;
A) Syntactically it is invalid to have more if clauses than else clauses
B) statement2 will only execute if condition1 is false and condition2 is false
C) statement2 will only execute if condition1 is true and condition2 is false
D) statement2 will only execute if condition1 is false, it does not matter what condition2 is
E) statement2 will never execute
Correct Answer:

Verified
Correct Answer:
Verified
Q22: Code Segment Ch 05-1<br>if (a > 0)<br>
Q23: As in the other members of the
Q24: Rewrite the following set of if statements
Q25: In Java, selection statements consist only of
Q26: What is wrong, logically, with the following
Q28: The statement {} is a legal block.
Q29: Consider the following code that will assign
Q30: Explain what is meant by short circuiting
Q31: Assume that boolean done = false, int
Q32: Assume that x and y are int