Skip to content

Instantly share code, notes, and snippets.

@hernandazevedozup
Last active March 29, 2019 11:17
Show Gist options
  • Save hernandazevedozup/3d2f639fb2437ec5079d0ac85276b2f4 to your computer and use it in GitHub Desktop.
Save hernandazevedozup/3d2f639fb2437ec5079d0ac85276b2f4 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