Skip to content

Instantly share code, notes, and snippets.

@hernandazevedo
Created March 29, 2019 12:52
Show Gist options
  • Save hernandazevedo/4be2413fddc27feabf446cf1cfcf9dc9 to your computer and use it in GitHub Desktop.
Save hernandazevedo/4be2413fddc27feabf446cf1cfcf9dc9 to your computer and use it in GitHub Desktop.
void main() {
Carro c1 = Carro("Fusca");
c1.acelerar(50);
c1.abastecer(50);
}
class Carro extends Automovel with Combustivel {
String nome;
Carro(this.nome);
void acelerar(int velocidade) {
print("Acelerando com $velocidade km/h");
}
String toString() => nome;
}
abstract class Automovel {
void acelerar(int velocidade) ;
}
class Combustivel {
abastecer(int qtde) {
print("Acelerando com $qtde");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment