上QQ阅读APP看书,第一时间看更新
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 {
};