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