Suppose I have a pure abstract class (that is, an abstract class without any implementation):
abstract class A {
abstract m(): void;
}
Building on @toskv's answer, if you extend an abstract class, you have to call super()
in the subclass's constructor. If you implement the abstract class, you don't have to call super()
(but you have to implement all the methods declared in the abstract class, including private methods).
Implementing an abstract class instead of extending it could be useful if you want to create a mock class for testing without having to worry about the original class's dependencies and constructor.