Skip to content

Instantly share code, notes, and snippets.

@10537
Created August 2, 2017 21:32
Show Gist options
  • Save 10537/a7359f9a6c8ef4002d6b19569ecacb1e to your computer and use it in GitHub Desktop.
Save 10537/a7359f9a6c8ef4002d6b19569ecacb1e to your computer and use it in GitHub Desktop.
Become a Kotlin Programmer Part 6 - Adding methods in your class
class Human() {
fun Walk(){
println("Walking...")
}
fun Run(){
println("Running...")
}
fun Talk(){
println("Hello, I'm $name")
}
fun Eat(){
println("I've eaten a fruit")
}
fun Learn(theme: String) {
println("I've learned $theme")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment