Wednesday, January 21, 2009

Abstract Class

An abstract class refers that object cannot be instantiated using those class type, but it can initialize using it's derived classes.

An abstract class can have both abstract methods and non abstract methods. Abstract members does not require any implementation in the abstract class, but the it should be defined in inherited class.

Some Behaviors of Abstract Classes 

  1. Abstract class cannot be a sealed class.
  2. An abstract method cannot be private.
  3. The access modifier of the abstract method should be same in both the abstract class and its derived class.
  4. An abstract method cannot have the modifier virtual. Because an abstract method is implicitly virtual.
  5. An abstract member cannot be static.

0 comments: