Skip to content

Instantly share code, notes, and snippets.

@igorwojda
Last active August 31, 2018 14:51
Show Gist options
  • Save igorwojda/ed36caf15c331a565b0db3e35e36ee20 to your computer and use it in GitHub Desktop.
Save igorwojda/ed36caf15c331a565b0db3e35e36ee20 to your computer and use it in GitHub Desktop.
class Person {
private var age: Int = 0
fun getAge(): Int {
return age
}
fun setAge(age: Int) {
this.age = age
}
}
//Usage
val person = Person()
person.setAge(20)
println(person.getAge()) //prints 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment