Skip to content

Instantly share code, notes, and snippets.

@faizul14
Last active August 12, 2023 13:17
Show Gist options
  • Save faizul14/f3fb426174a0c4538663b94f9ae5e3b9 to your computer and use it in GitHub Desktop.
Save faizul14/f3fb426174a0c4538663b94f9ae5e3b9 to your computer and use it in GitHub Desktop.
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