In the previous post in this series, I walked through:
- the basics of abstract classes,
- how to implement them,
- and provided working code examples.
And though I think understanding abstract classes are key in laying a strong foundation for object-oriented programming, I often see that it can be confusing when it comes to comparing them to interfaces and knowing when to use them.
Abstract Classes and Interfaces
So in this post, I’m going to share:
- a quick refresher on what interfaces are,
- what abstract classes are,
- and then how to know when to use one over the other.
This shouldn’t be a coding intensive article, but it should help know when to write code of a certain type to help better organize your projects.