...

/

Quiz: Data Classes

Quiz: Data Classes

Test your understanding of the concepts discussed in this chapter.

We'll cover the following...
Technical Quiz
1.

What is printed by the following code?

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

fun main() {
   val user1 = User("John", 25)
   val user2 = user1.copy()
   println(user1 == user2)
}
A.

true

B.

false

C.

Compilation error

D.

Runtime error


1 / 5
...