官术网_书友最值得收藏!

  Inheritance

Interfaces can extend one or more interfaces if they want to carry out other interface operations, and in addition to that, declare their own operations as follows:

module EmployeeHierarchy {
interface Person {
typedef unsigned short ushort;
ushort method1();
};
interface Employee : Person {
Boolean method2(ushort num);
};
};

In the preceding code, the Employee interface extends the Person interface and adds method2() in addition to method1() inherited from the Person interface.

The following is an example of one interface inheriting multiple interfaces:

interface Clerk: Person, Employee, Associate::Administrator {
};
主站蜘蛛池模板: 酒泉市| 庆元县| 卢湾区| 永修县| 濮阳市| 庆城县| 仁化县| 常德市| 宜城市| 丹阳市| 南平市| 壶关县| 吉安县| 洛南县| 北海市| 奉化市| 浪卡子县| 通道| 横峰县| 宣化县| 寻乌县| 和平县| 长岭县| 枞阳县| 北川| 乌拉特前旗| 台东市| 天门市| 博客| 天长市| 江油市| 家居| 巴彦淖尔市| 丰顺县| 泸州市| 大邑县| 六盘水市| 西青区| 尼勒克县| 沙雅县| 梁平县|