1
class extends superclass implements interface1, interface2
2
interface extends interface1, interface2
类是单继承,接口是多继承
类必须是先继承后实现接口, 顺序不能颠倒
本文介绍了面向对象编程中类和接口的基本继承特性。类遵循单继承原则,而接口支持多继承。文章还强调了在定义类时必须先进行继承再实现接口的规则。
1
class extends superclass implements interface1, interface2
2
interface extends interface1, interface2
类是单继承,接口是多继承
类必须是先继承后实现接口, 顺序不能颠倒
2709
679

被折叠的 条评论
为什么被折叠?