- Distributed Computing in Java 9
- Raja Malleswara Rao Pattamsetti
- 95字
- 2021-07-02 21:02:37
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 {
};
推薦閱讀
- INSTANT Mock Testing with PowerMock
- 造個小程序:與微信一起干件正經事兒
- 構建移動網站與APP:HTML 5移動開發入門與實戰(跨平臺移動開發叢書)
- BeagleBone Media Center
- Python神經網絡項目實戰
- 利用Python進行數據分析(原書第3版)
- Learning OpenStack Networking(Neutron)
- iOS開發實戰:從入門到上架App Store(第2版) (移動開發叢書)
- Python機器學習算法: 原理、實現與案例
- Spring 5 Design Patterns
- Visual FoxPro 6.0程序設計
- Getting Started with Python
- 從Power BI到Analysis Services:企業級數據分析實戰
- Mobile Forensics:Advanced Investigative Strategies
- 基于MATLAB的控制系統仿真及應用