Java abstact class vs Interface

Lets see how Abstract classes and Interfaces differs,

  • Abstract classes supports both abstract(methods without definition) and non-abstract methods.
  • Interface supports only abstract method, then multiple Default and Static methods.
  • Interface supports multiple inheritance by implementing multiple interfaces.
  • Abstract class doesn’t provide support for multiple inheritance.
  • Interface can’t provide implementation of abstract class.
  • Abstract class can provide implementation of interface by defining their methods.
  • Abstract class can extend other java class and implement multiple interfaces.
  • Interface only extends other interfaces only.

原文链接:Java abstact class vs Interface

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容