Skip to content

Instantly share code, notes, and snippets.

@psygo
Last active May 25, 2020 17:32
Show Gist options
  • Save psygo/dc006e14f2f2d7f871f0bf290417122a to your computer and use it in GitHub Desktop.
Save psygo/dc006e14f2f2d7f871f0bf290417122a to your computer and use it in GitHub Desktop.
Abstract Classes with Constructors: Why?
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