abstract method use vs regular methods

前端 未结 6 1067
醉酒成梦
醉酒成梦 2021-01-13 06:45

I would like to know the difference between two conventions:

  1. Creating an abstract base class with an abstract method which will be implemented later on the der
6条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 06:55

    Uhm, well, the difference is that the base class would know about the former, and not about the latter.

    In other words, with an abstract method in the base class, you can write code in other methods in the base class that call that abstract method.

    Obviously, if the base class doesn't have those methods... you can't call them...

提交回复
热议问题