Start learning →

To which if clause does an else clause bind by standard convention?

AThe outermost if clause
BThe first defined if
CNearest preceding if
DAny arbitrary outer if
Answer & Solution
Correct answer: C. Nearest preceding if
By convention an else clause associates with the nearest preceding if clause.
Practise this question with Quill — ICSE Class 8 →

Keep practising Conditional Statements in Java

Browse all Conditional Statements in Java questions for ICSE Class 8, or explore more Computer Applications topics.

Start a Conditional Statements in Java lesson →