Created
February 2, 2020 14:52
-
-
Save magdamiu/01a0fddd3bdcd33fa585c8cca98d0afc to your computer and use it in GitHub Desktop.
Abstract classes in Kotlin
This file contains 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
abstract class Car { | |
abstract fun run() | |
open fun computeTaxes() {} | |
} | |
abstract class SafeCar: Car() { | |
override fun run() { | |
println("SafeCar is running safely..") | |
} | |
override abstract fun computeTaxes() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment