Created
October 23, 2023 13:29
-
-
Save sasssass/c925d87bf91f745dbe022d031757cddb to your computer and use it in GitHub Desktop.
abstractation.kt
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 Animal(val name: String) { | |
fun move() { | |
// Imp | |
} | |
abstract fun eat() | |
} | |
class Bird (name: String) : Animal(name) { | |
override fun eat() { | |
// Imp | |
} | |
} | |
fun main() { | |
val bird: Animal = Bird("Canary") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment