Created
March 28, 2019 10:47
-
-
Save hernandazevedozup/8015d7205d4c91b5bf3963ac547fe030 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"); | |
Carro c2 = Carro("Brasilia"); | |
Carro c3 = Carro("Chevete"); | |
//List<Carro> carros = List<Carro>(); | |
//carros.add(c1); | |
//carros.add(c2); | |
//carros.add(c3); | |
var carros = [c1, c2, c3]; | |
print ("Lista $carros"); | |
for(Carro c in carros) { | |
print(">> ${c.nome}"); | |
} | |
} | |
class Carro { | |
String nome; | |
Carro(this.nome); | |
String toString() { | |
return nome; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment