When use interface and when abstract class

Since abstract and interface both provide abstract methods to be implemented by child class

Interface contains only declaration but not the implementation.

An abstract class can have implementation as well.

So if we have a scenario where we need a default implementation we will use abstract class else anything we can use.

But the best is if you use interface With abstract class.

Leave a comment