Created
December 1, 2020 08:17
-
-
Save pgainullin/0ce9d7652217b36416484526fe532192 to your computer and use it in GitHub Desktop.
Dart assignment for different types
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() { | |
int a = 5; | |
print(a); | |
int b = a; | |
print(b); | |
a = 23; | |
print(b); | |
String aString = '5'; | |
print(aString); | |
String bString = aString; | |
print(bString); | |
aString = '23'; | |
print(bString); | |
ComplexObject aComplex = ComplexObject(5); | |
print(aComplex.data); | |
ComplexObject bComplex = aComplex; | |
print(bComplex.data); | |
aComplex.data = 23; | |
print(bComplex.data); | |
} | |
class ComplexObject { | |
int data; | |
ComplexObject(this.data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Console
5
5
5
5
5
5
5
5
23