DEV Community

Discussion on: How do you choose between an interface and abstract class?

Collapse
 
unitycoach profile image
Unity Coach

I work in the game industry and actually happen to use both interfaces and abstract together. In some cases, abstract base classes can implement interfaces, which makes it pretty handy later not to have to know what such or such class can do. You simply add different "can-do" to different levels of "is-a".

Collapse
 
suhas_chatekar profile image
Suhas Chatekar

And that makes perfect sense. You have an interface to represent the "can-do" relationship and an abstract class where you can stash any common implementation.