Skip to content

Instantly share code, notes, and snippets.

@catalunha
Last active August 31, 2023 19:09
Show Gist options
  • Save catalunha/b5b6f20deced911f786ca2d28146a685 to your computer and use it in GitHub Desktop.
Save catalunha/b5b6f20deced911f786ca2d28146a685 to your computer and use it in GitHub Desktop.
Resumo Dart - POO - Exemplo class Mamifero

Resumo Dart - POO - Exemplo class Mamifero

Created with <3 with dartpad.dev.

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