Abstract vs Regular Super Class

oop

Solution

I think the comments and answers have already implied this, but I want to state it more bluntly: You can't do everything with a regular super class that you can do with a abstract class. An abstract class lets you define the signature of a method without including its implementation, and an abstract class won't allow you to instantiate it directly.

So if I have an class signature in mind with 3 methods and I don't want to share the implementations for any of them, I'll use an interface. If I want to share the implementation for one of those methods I'll use an abstract class, then make two of the methods in that class abstract. If I want to share all of the implementations for the methods I'll either use an abstract class, if it never makes sense to instantiate it directly, or I'll use a regular class if it does.

(This is based on my experience in C#. Details differ between languages.)

Problem

If everything I can do with an abstract class I can do with a regular super class, why would I ever use an abstract class when I could use a regular super class?

Original source