问题描述
抽象类可以继承自接口类吗?我的programme中有8个类.Taxi,Subway和Buss继承自抽象的公共交通工具。还有Taxi和Buss继承自车辆,这是一个接口class.mid-buss和从buss和limo继承的大巴继承自Taxi.i需要说buss和taxi也是抽象类。现在我们有一个从接口继承的抽象类,所以我必须实现Taxi和Buss类中的方法。设计上面的内容是否正确?
Can an abstract class inherits from an interface class ?I have 8 classes in my programme.Taxi,Subway and Buss inherit from abstract public transportation.and also Taxi and Buss inherit from vehicle which is an interface class.mid-buss and large-buss inherit from buss and limo inherits from Taxi.i need to say buss and taxi are also abstract classes.now we have an abstract class which inherits from interface so i have to implement the methods in the Taxi and Buss classes. is it correct to design something like above or not ?
这篇关于接口和抽象类之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!