我也困惑这个问题,我发现abstract可以从interface或abstract继承,但是interface只能从interface继承。还有,abstract类中加构造函数的话,只要不实例化,都不会出错的。

解决方案 »

  1.   

    这句话在《c#设计模式(c#Design Patterns:A Turorial)》[美]Janmes W.Cooper著
    张志华 刘云鹏等译
    电子工业出版社52页 5.13小节第二段。如果一个抽象类的所有方法在基类中都没有实现,他本质上就等同于一个接口,但限制条件是,一个类不能从他继承,也不能继承其他类层次结构,而使用接口则可以这么做。
      

  2.   

    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.这是原话。翻译得有问题。
    他的本意应该是:你不能创建一个类既从这个抽象类继承,又从其他类继承,(即:不能多重继承),但是用接口却可以(创建一个类,既从接口继承,又从其他类或接口继承)。
      

  3.   

    支持adailee(为了一棵树,我放弃了整个森林)
    抽象类不支持多重继承,而接口可以多重继承