Interfaces
上一节
下一节
Concept and Syntax
An interface is a class-like construct that contains only constants and abstract methods. 接口是一种类似类的结构,只包含常量和抽象方法,定义时要采用interface关键词,其语法如下:

类实现接口时采用implements关键词,其语法如下:

一个类可以实现多个接口,多个接口之间用逗号隔开,类需要实现接口中的所有方法。

