Can one abstract class extend another abstract class and increase functionality

前端 未结 5 994
灰色年华
灰色年华 2021-02-01 03:15

I have an abstract class. I want to extend the abstract class by another abstract class and then implement the extended abstract class. Is it possible .If yes, whether it\'s a g

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 03:51

    I'm not sure about Java in particular, but it should be valid.

    In terms of OOP, if it makes sense, then run with it. To use some old examples, you might have a Vehicle abstract class and then LandVehicle and FlyingVehicle abstract classes. As long as your example makes sense as an abstract class, then you should be fine.

提交回复
热议问题