Created
May 9, 2020 17:15
-
-
Save samisnotinsane/93fac4c3dd5ed293e720324f40f66796 to your computer and use it in GitHub Desktop.
Constructors in Dart
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() { | |
Human jenny = Human(height: 145, weight: 47); | |
print(jenny.height); | |
print(jenny.weight); | |
Human sam = Human(height: 166, weight: 71); | |
print(sam.height); | |
print(sam.weight); | |
} | |
class Human { | |
double height; | |
double weight; | |
Human({this.height, this.weight}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment