- C# 7 and .NET Core Cookbook
- Dirk Strauss
- 121字
- 2021-07-03 00:11:58
Creating and implementing an interface
For many developers, interfaces are equally confusing and their purpose not clearly understood. Interfaces are actually quite easy to get to grips with once you understand the concept that defines an interface.
Interfaces act like verbs. So, for example, if we had to create two classes called Lion and Tiger that derive from the Cat abstract class, the interface would describe some sort of action. Lions and tigers can roar (but not purr). We can then create an interface called IRoarable. If we had to derive a class called Cheetah from our abstract class Cat, we would not be able to use the IRoarable interface, because cheetahs purr. We would need to create an IPurrable interface.
推薦閱讀
- Oracle WebLogic Server 12c:First Look
- Boost C++ Application Development Cookbook(Second Edition)
- Oracle Database In-Memory(架構與實踐)
- Offer來了:Java面試核心知識點精講(原理篇)
- C語言程序設計教程(第2版)
- 游戲程序設計教程
- Instant QlikView 11 Application Development
- 程序員修煉之道:通向務實的最高境界(第2版)
- INSTANT Django 1.5 Application Development Starter
- Android應用案例開發大全(第二版)
- Python深度學習:模型、方法與實現
- C語言程序設計實踐
- Android移動應用項目化教程
- 軟件測試分析與實踐
- 零基礎學SQL(升級版)