Introduction

One of the meanings of the abstract word is “exists in thought as an idea but does not have a physical or concrete existence". In .Net, an abstract class is a special type of class that acts as a base class and cannot be instantiated. Class members (methods, properties, indexers and events) are marked as abstract; it must be implemented by a derived class.

Example

  1. public abstract class Test
  2. {
  3. public abstract string GetName();
  4. public string GetOtherName()
  5. {
  6. return "Other";
  7. }
  8. }
An abstract class has the following features:

Feature of abstract members

Abstract methods

Abstract properties

When to use an abstract Class

Design guidelines for Abstract Class

Summary

This was all about abstract classes.