Just for fun. Let's guess the output result. ```da...
# kotlin-native
m
Just for fun. Let's guess the output result.
Copy code
data class MyNumber(
    var x: Int
) {
    val isBig1: Boolean = x >= 10

    val isBig2: Boolean
        get() = x >= 10
}

fun main() {
    val number = MyNumber(9)
    println("isBig1 before: ${number.isBig1}")
    println("isBig2 before: ${number.isBig2}")
    number.x = 11
    println("isBig1 after: ${number.isBig1}")
    println("isBig2 after: ${number.isBig2}")
}
đŸ‘€ 1
r
Copy code
false
false
false
true
that’s because isBig2 is actually getter
✅ 2