Chapter 13. Creating Interfaces and Defining Abstract Classes
After completing this chapter, you will be able to:
Define an interface identifying the names of methods.
Implement an interface in a structure or class by writing the bodies of the methods.
Capture common implementation details in an abstract class.
Declare that a class cannot be used as a base class by using the sealed keyword.
Inheriting from a class is a powerful mechanism, but the real power of inheritance comes from inheriting from an interface. An interface does not contain any code or data; it just specifies the methods and properties that a class that inherits from the interface must provide. Using an interface enables you to completely separate the names and signatures of the methods ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access