Vidyalelo
Computer Science · Q249

Kotlin Programming MCQ for Competitive Exams, Interviews, and Certifications

Engineering and GATE · Computer Science · question 249

Q249

How can you retrieve the value of the property codeName without referring to it by name or destructuring? data class Project(var codeName: String, var version: String) fun main() val proj = Project("Chilli Pepper", "2.1.0")

A.
proj.0
B.
proj[0]
C.
proj[1]
D.
proj.component1()
Answer

Answer: Option D

Solution

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