- Apache Spark 2.x for Java Developers
- Sourav Gulati Sumit Kumar
- 121字
- 2021-07-02 19:01:55
Interfaces
Interfaces are the reference types in Java. They are used in Java to define contracts among classes. Any class that implements that interface has to adhere to the contract that the interface defines.
For example, we have an interface car as follows that consists of three abstract methods:
public interface Car { void shape(); void price(); void color(); }
Any class that implements this interface has to implement all the abstract methods of this interface unless it is an abstract class. Interfaces can only be implemented or extended by other interfaces, they cannot be instantiated.
Prior to Java 8, interfaces consisted only of abstract methods and final variables. In Java 8, interfaces may contain default and static methods as well.
推薦閱讀
- Design Principles for Process:driven Architectures Using Oracle BPM and SOA Suite 12c
- 編程卓越之道(卷3):軟件工程化
- Python測試開發入門與實踐
- Apache Spark Graph Processing
- Learning Laravel 4 Application Development
- YARN Essentials
- Python編程實戰
- Python Web數據分析可視化:基于Django框架的開發實戰
- Mastering Git
- 用案例學Java Web整合開發
- Deep Learning with R Cookbook
- Windows Phone 8 Game Development
- ABAQUS6.14中文版有限元分析與實例詳解
- AI自動化測試:技術原理、平臺搭建與工程實踐
- Deep Learning for Natural Language Processing