When to use interfaces, when to use abstract class?

When to use an interface? When to use abstract class?

If this concept in our mind is indeed exists, use an abstract class.

Otherwise, if the concept is just one aspect of characteristics, such as fly, run, which we set for the interface.

Two concepts blur, I do not know when to abstract classes or interfaces, we generally set the interface, because we implement this interface can also be inherited.

 

Guess you like

Origin www.cnblogs.com/hengzhezou/p/11204441.html