Created
March 31, 2021 05:18
-
-
Save misterfourtytwo/1405ef7605c8b09ebf93db80ae0ba40a to your computer and use it in GitHub Desktop.
sandbox git for checking out dart classes behavior
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
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