Vidyalelo
Computer Science · Q265

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 265

Q265

What is the equivalent of the following Java expression in Kotlin? int x = a ? b : c

A.
val x = a ?: b, c
B.
val x = if (a) b else c
Answer
C.
val x = a ? b : c
D.
val x = if (a) b: c

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board