Last active
August 12, 2023 13:17
-
-
Save faizul14/f3fb426174a0c4538663b94f9ae5e3b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Person(val name: String, var age: Int) | |
val person = Person("Renren", 22) | |
with(person) { | |
println("Name: $name") | |
println("Age: $age") | |
age += 1 | |
} | |
// Output: | |
// Name: Renren | |
// Age: 30 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment