Why do we need abstract classes in C++?

前端 未结 10 2100
暗喜
暗喜 2020-12-14 03:19

I\'ve just learned about polymorphism in my OOP Class and I\'m having a hard time understanding how abstract base classes are useful.

What is the purpose of an abstr

10条回答
  •  轮回少年
    2020-12-14 03:36

    I have a dog. Abstract class dog with a method bark. My particular dog makes one bark. Other dogs bark in a different way. So defining a dog in the abstract way is useful.

提交回复
热议问题