Created with <3 with dartpad.dev.
Last active
August 31, 2023 19:09
-
-
Save catalunha/b5b6f20deced911f786ca2d28146a685 to your computer and use it in GitHub Desktop.
Resumo Dart - POO - Exemplo class Mamifero
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 Mamifero { | |
String mover(){return '';} | |
} | |
class Macaco extends Mamifero { | |
@override | |
String mover() { | |
return 'pulando'; | |
} | |
} | |
class Homem extends Mamifero { | |
@override | |
String mover() { | |
return 'andando'; | |
} | |
} | |
void main() { | |
Mamifero mamifero; | |
mamifero = Homem(); | |
print(mamifero.mover()); | |
mamifero = Macaco(); | |
print(mamifero.mover()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment