The Syntax and Terminologies
Explore the fundamental syntax and terms of inheritance in C#. Understand the roles of base and derived classes, access modifiers including protected, and how to implement inheritance using practical examples with a vending machine project.
The Terminologies
Since we know that a new class is created based on an existing class in inheritance, we use the terminology below for the new class and the existing class:
- Base Class (Mother Class or Superclass): This class allows the re-use of its
non-privatemembers in another class. - Derived Class (Child Class or Subclass): This class is the one that inherits from the superclass.
A child class has all ...