Skip to content

Instantly share code, notes, and snippets.

@ryanlid
Created June 26, 2019 09:30
Show Gist options
  • Save ryanlid/752f4db9302e69bd9a58b7901dd98c86 to your computer and use it in GitHub Desktop.
Save ryanlid/752f4db9302e69bd9a58b7901dd98c86 to your computer and use it in GitHub Desktop.
class
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