© Vaskaran Sarcar 2018
Vaskaran SarcarInteractive C#https://doi.org/10.1007/978-1-4842-3339-9_3

3. The Concept of Inheritance

Vaskaran Sarcar
(1)
560066 Bangalore, Karnataka, India
 
Teacher starts the discussion: The main objective of inheritance is to promote reusability and eliminate redundancy (of code). The basic idea is that a child class can obtain the features/characteristics of its parent class. In programming terms, we say that a child class is derived from its parent/base class. Therefore, the parent class is placed at a higher level in the class hierarchy.

Types

In general, we deal with four types of inheritance.
  • Single inheritance : A child class is derived from one base class
  • Hierarchical inheritance : Multiple child classes can ...

Get Interactive C#: Fundamentals, Core Concepts and Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.