Created
June 26, 2019 08:08
-
-
Save ryanlid/4a0ebc1fd8a67fa95d30194a91ae1e07 to your computer and use it in GitHub Desktop.
dart class
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 jenny = Human(startingHeight: 15); | |
print(jenny.height); | |
Human jemes = Human(startingHeight: 20); | |
print(jemes.height); | |
jemes.talk("hello"); | |
} | |
class Human { | |
double height; | |
int age = 0; | |
Human({double startingHeight}) { | |
height = startingHeight; | |
} | |
void talk(String whatToSay) { | |
print(whatToSay); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment