abstract class 和 interface 有什么区别?

参考解答

  • 接口中没有构造方法;接口中的方法只能是公共的、抽象的;变量只能是public static final的
  • 抽象类除了不能被实例化,其它普通类能有的功能抽象类都有
  • 抽象类只能单继承,接口可以多继承、多实现

results matching ""

    No results matching ""