Created with <3 with dartpad.dev.
Last active
March 29, 2023 03:11
-
-
Save yusufpats/6cc1016f41c4019bd4847c4c465fcae6 to your computer and use it in GitHub Desktop.
enchanted-illusion-7138
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
class Animal { | |
void sound(){ | |
print("I will play a sound"); | |
} | |
} | |
class Cat extends Animal { | |
@override | |
void sound(){ | |
super.sound(); | |
print("Meow"); | |
} | |
void walk(){ | |
} | |
} | |
class Fish extends Animal { | |
@override | |
void sound(){ | |
print("Dont know"); | |
} | |
void swim(){ | |
} | |
} | |
void main() { | |
Cat tiger = new Cat(); | |
tiger.sound(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment