Comparing Kotlin Data Class Objects

Report a typo

Consider the following Kotlin code snippet:

data class User(val name: String, val age: Int)

fun main() {
    val user1 = User("John", 25)
    val user2 = User("John", 25)
    val user3 = user1

    println(user1 == user2)
    println(user1 === user2)
    println(user1 == user3)
    println(user1 === user3)
}

Which of the following statements regarding the output of the snippet are correct?

Select one or more options from the list
___

Create a free account to access the full topic