Skip to content
RED SAG Skills
hardStudy question · answer published in Kotlin interview questions, so no pointsandroidkotlindata-classes

Property declared in the class body

What does this print?

data class User(val id: Int) {
    var name: String = ""
}

val a = User(1).apply { name = "Asha" }
val b = User(1).apply { name = "Ravi" }
println(a == b)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions