Start learning →

Which operator can replace a simple if statement in Java?

AThe ?? operator
BThe && operator
CThe ?: operator
DThe || operator
Answer & Solution
Correct answer: C. The ?: operator
The ternary operator ?: can be used in place of a simple if statement.
Practise this question with Quill — ICSE Class 10 →

Keep practising Classes, Encapsulation and Scope

Browse all Classes, Encapsulation and Scope questions for ICSE Class 10, or explore more Computer Applications topics.

Start a Classes, Encapsulation and Scope lesson →