Skip to content

Instantly share code, notes, and snippets.

@misterfourtytwo
Created March 31, 2021 05:18
Show Gist options
  • Save misterfourtytwo/1405ef7605c8b09ebf93db80ae0ba40a to your computer and use it in GitHub Desktop.
Save misterfourtytwo/1405ef7605c8b09ebf93db80ae0ba40a to your computer and use it in GitHub Desktop.
sandbox git for checking out dart classes behavior
class SuperClass {
void hello() => print('hello');
void world() {
hello();
print('world!');
print('');
}
}
class SubClass extends SuperClass {
@override
void hello() => print('hi');
}
void main() {
print('super class:');
final x = SuperClass();
x.world();
print('sub class:');
final y = SubClass();
y.world();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment