Start learning →

In condition ? val1 : val2, what is returned when condition is false?

AThe true-value val1
BThe boolean false
CA thrown exception
DThe false-value val2
Answer & Solution
Correct answer: D. The false-value val2
The conditional ternary operator evaluates to the false-value when condition is false.
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 →