Skip to content

Instantly share code, notes, and snippets.

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