Introduction

Completed

Class inheritance is a fundamental concept in object-oriented programming. Inheritance enables the creation of class hierarchies, promotes code reuse, and extensibility. This module focuses on understanding and implementing inheritance in C#.

Imagine you're working at a non-profit company that's in the midst of a software update project. The application's complexity requires a modular and reusable code structure, and you're concerned about code readability, maintainability, and organization. You need to understand how to implement a class hierarchy that implements inheritance and support polymorphic behavior. This module guides you through these concepts and provides practical examples to help you apply them in your work.

The topics covered in this module include:

  • Examine the principles of class inheritance.
  • Configure base and derived classes.
  • Extend a derived class with new members.
  • Override properties and methods in a derived class.
  • Access base class members from a derived class.
  • Implement base and derived classes in a C# app.

After completing this module, you're able to:

  • Explain the principles of class inheritance.
  • Describe the default characteristics of a derived class.
  • Control the visibility of inherited members using access modifiers and keywords like abstract, virtual, and sealed.
  • Describe the use of new and override keywords in a derived class.
  • Override properties and methods in a derived class.
  • Access base class members in a derived class.
  • Implement base and derived classes in a C# app.

By the end of this module, you have a solid understanding of class inheritance in C# and you're able to implement a class hierarchy using base and derived classes.