Created
August 2, 2017 21:40
-
-
Save 10537/9cabdedf46178d134be2b595ee914e6b to your computer and use it in GitHub Desktop.
Become a Kotlin Part 6 - Character Open Class Inheritance
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
open class Character(open var name: String) { | |
var healh = 100 | |
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