In this article we will cover following points:
1.Abstract class basics
2. Abstract classes members
3. Abstract methods
4. Abstract Properties
5. Abstract class implementing an interface
1.An abstract class is created using the abstract keyword.
2. An abstract modifier can be used with classes, methods, properties, indexers and events.
3. An abstract modifier indicates missing or incomplete implementation of the member which is
marked as abstract.
4. An abstract class cannot be instantiated.
5. An abstract class may contain abstract members (methods, properties, indexers and events)
but its not essential/mandatory.
6. An abstract class cannot be sealed. Because the sealed modifier prevents a class from
being inherited and the abstract modifier requires a class to be inherited.
7. A non-abstract class derived from an abstract class must include actual implementations of
all inherited abstract methods and accessors.
8. If the class does not provide implementation for all the abstract members inherited from the
abstract class then the child class has to be marked as abstract.
1.Use the abstract modifier in a method or property declaration to indicate that method or
property does not contain implementation.
2. An abstract method is implicitly a virtual method.
3. Abstract method declaration are only permitted inside abstract classes.
4. It is an error to use the static or virtual modifiers in an abstract method declaration.
1.It is an error to use the abstract modifier on a static property.
2. An abstract inherited property can be overridden in a derived class by including a property
declaration that uses override modifier.
Abstract class implementing an interface
1.An abstract class must provide implementation for all interface members.
2. An abstract class that implements an interface might mark the interface methods as abstract
methods to avoid providing method implementation.