- 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 {
};
推薦閱讀
- Spring 5.0 Microservices(Second Edition)
- Java范例大全
- Visual FoxPro程序設計教程
- Oracle從新手到高手
- INSTANT FreeMarker Starter
- Mastering Kotlin
- Learning Neo4j 3.x(Second Edition)
- OpenShift在企業(yè)中的實踐:PaaS DevOps微服務(第2版)
- Gradle for Android
- 細說Python編程:從入門到科學計算
- Webpack實戰(zhàn):入門、進階與調(diào)優(yōu)(第2版)
- Mastering VMware Horizon 7(Second Edition)
- 計算語言學導論
- Java從入門到精通(視頻實戰(zhàn)版)
- Learning Shiny