一个抽象类可以扩展另一个抽象类并增加功能吗 [英] Can one abstract class extend another abstract class and increase functionality
问题描述
我有一个抽象类.我想通过另一个抽象类扩展抽象类,然后实现扩展的抽象类.是否可能.如果是,从 OOPS 的角度来看,这是否是一种好方法?
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 good approach in point of view regarding OOPS?
推荐答案
我不太清楚 Java,但它应该是有效的.
I'm not sure about Java in particular, but it should be valid.
就OOP而言,如果它有意义,那么就运行它.要使用一些旧示例,您可能有一个 Vehicle
抽象类,然后是 LandVehicle
和 FlyingVehicle
抽象类.只要您的示例作为抽象类有意义,那么您应该没问题.
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.
这篇关于一个抽象类可以扩展另一个抽象类并增加功能吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!