Vidyalelo
Computer Science · Q232

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 232

Q232

Your code need to try casting an object. If the cast is not possible, you do not want an exception generated, instead you want null to be assigned. Which operator can safely cast a value?

A.
as?
Answer
B.
??
C.
is
D.
as

Answer: Option A

Solution

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