Created
January 10, 2022 18:49
-
-
Save felipecastrosales/f642ecd6edf496f62c079adaa12e6362 to your computer and use it in GitHub Desktop.
Variáveis | Inferência de Tipo
This file contains hidden or 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() { | |
// 1. Sem Inferência de Tipo: | |
String nome1 = 'Rocketseat'; | |
bool escola1 = true; | |
int quantidade1 = 3; | |
print(nome1); | |
print(escola1); | |
print(quantidade1); | |
print(nome1.runtimeType); | |
print(escola1.runtimeType); | |
print(quantidade1.runtimeType); | |
/////////////////////////////////////////////////// | |
// 2. Com Inferência de Tipo: | |
var nome2 = 'Rocketseat'; // String | |
var escola2 = true; // bool | |
var quantidade2 = 3; // int | |
print(nome2); | |
print(escola2); | |
print(quantidade2); | |
print(nome2.runtimeType); | |
print(escola2.runtimeType); | |
print(quantidade2.runtimeType); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment