What is the result?

Report a typo

Look at the code below. What result will be printed?

data class Person(val name: String, var age: Int)

fun main() {
    val person = Person("John", 20)
    println(person.age)
    person.age = 21
    println(person.age)
}
Select one option from the list
___

Create a free account to access the full topic