Created
May 30, 2019 20:01
-
-
Save Zenderable/9e9dd3917cefff392f270f082b119e5a to your computer and use it in GitHub Desktop.
Example of constructor in Dart
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() { | |
Human mark = Human(186); | |
Human elon = Human(169); | |
print(mark.height); | |
print(elon.height); | |
} | |
class Human { | |
int height; | |
Human(int height) { | |
this.height = height; | |
} | |
} |
Author
Zenderable
commented
May 30, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment