Last active
May 25, 2020 17:32
-
-
Save psygo/dc006e14f2f2d7f871f0bf290417122a to your computer and use it in GitHub Desktop.
Abstract Classes with Constructors: Why?
This file contains 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() { | |
final B b1 = B(); | |
final C c1 = C(); | |
} | |
abstract class A { | |
A(){ | |
print('hello from A'); | |
} | |
} | |
class B extends A { | |
// will print "hello from A" | |
} | |
class C implements A { | |
// will print nothing | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment