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

  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 {
};
主站蜘蛛池模板: 广平县| 文昌市| 沅陵县| 晴隆县| 梁平县| 朝阳县| 湖南省| 永济市| 克东县| 延川县| 乳山市| 襄城县| 绿春县| 曲松县| 广河县| 岚皋县| 江门市| 中西区| 揭西县| 阳朔县| 连云港市| 华安县| 崇阳县| 霍城县| 庄河市| 壤塘县| 湘西| 文成县| 察雅县| 乐业县| 银川市| 中卫市| 饶平县| 江油市| 巩义市| 平和县| 丰城市| 台东市| 张掖市| 南华县| 无棣县|