OP第十一章Poly.pptVIP

  • 12
  • 0
  • 约2.6万字
  • 约 43页
  • 2016-11-29 发布于江苏
  • 举报
用implements子句来表示一个类使用某个接口。 在类体中可以使用接口中定义的常量,而且必须实现接口中定义的所有方法。 利用接口可实现多重 继承,即一个类可以实现多个接口,在implements子句中用逗号分隔。 接口的作用和抽象类相似,只定义原型,不直接定义方法的内容。 接口中的方法和变量必须是public的。 Implementation inheritance hierarchies tend to have their functionality high in the hierarchy – each new subclass inherits one or more methods that were implemented in a superclass, and the subclass uses the superclass implementation.。 Interface inheritance hierarchies tend to have their functionality lower in the hierarchy – a superclass specifies one or more abstract methods that must be declared for each concrete class in the hi

文档评论(0)

1亿VIP精品文档

相关文档