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

  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 {
};
主站蜘蛛池模板: 昭觉县| 任丘市| 同江市| 江华| 沙雅县| 芦山县| 南平市| 凤山市| 台江县| 高要市| 临泉县| 宽甸| 衡东县| 浦东新区| 若尔盖县| 洪泽县| 巫山县| 平度市| 闻喜县| 张家界市| 苏尼特右旗| 博客| 仁寿县| 临猗县| 柳江县| 申扎县| 张家川| 柳林县| 罗平县| 贵南县| 安宁市| 江阴市| 宣城市| 佛山市| 兴业县| 扶绥县| 南宁市| 临高县| 安丘市| 晋中市| 本溪|