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