C# Abstract Classes

An abstract class in a special class that can’t be instantiated because they are incomplete. The abstract class contains only the definition of the properties or methods. An abstract class is a base class and must be implemented in a non-abstract class using the override keyword.

Static, value types and interfaces don’t support abstract modifiers. Static members cannot be in abstract classes and abstract members must also be abstract.

The purpose of an abstract class is to define common behavior that can be inherited by multiple subclasses without implementing the entire class.

The difference between interfaces and abstract class is an interface defines only pure virtual functions while an abstract class may also include concrete function members or any other aspect of a class.

abstract class Employee
        public abstract double Salary { get; set; }
        public abstract double TotalHours { get; set; }
        public abstract double GetTotalPay();