easyStudy question · answer published in Android interview questions, so no pointskotlindata-classes
Kotlin data class equality
What does this Kotlin code print?
data class User(val id: Int, val name: String) val a = User(1, "Ana") val b = User(1, "Ana") println(a == b) println(a === b)
Discussion 0
Join free to post in the discussion.
Related questions
- Kotlin Elvis operatorMobile App Developer
- Kotlin val with a mutable listMobile App Developer
- lateinit or by lazyMobile App Developer
- A chain of safe callsMobile App Developer
- What !! does on nullMobile App Developer
- What let returnsMobile App Developer
- Configuring an object with applyMobile App Developer
- object declarationMobile App Developer