Last active
August 31, 2018 14:51
-
-
Save igorwojda/ed36caf15c331a565b0db3e35e36ee20 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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