Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Created February 2, 2020 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magdamiu/01a0fddd3bdcd33fa585c8cca98d0afc to your computer and use it in GitHub Desktop.
Save magdamiu/01a0fddd3bdcd33fa585c8cca98d0afc to your computer and use it in GitHub Desktop.
Abstract classes in Kotlin
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