If all the methods of an abstract class are unimplemented in the base class, it is essentially the same as an interface, but with the restriction that you can’t make a class inherit from it as well as from another class hierarchy as you could with an interface.这是原话。翻译得有问题。 他的本意应该是:你不能创建一个类既从这个抽象类继承,又从其他类继承,(即:不能多重继承),但是用接口却可以(创建一个类,既从接口继承,又从其他类或接口继承)。
张志华 刘云鹏等译
电子工业出版社52页 5.13小节第二段。如果一个抽象类的所有方法在基类中都没有实现,他本质上就等同于一个接口,但限制条件是,一个类不能从他继承,也不能继承其他类层次结构,而使用接口则可以这么做。
他的本意应该是:你不能创建一个类既从这个抽象类继承,又从其他类继承,(即:不能多重继承),但是用接口却可以(创建一个类,既从接口继承,又从其他类或接口继承)。
抽象类不支持多重继承,而接口可以多重继承