We usually think of classes as being complete definitions. However, there are situations where complete definitions of a class is not possible. In OO, we can create a class that have incomplete definitions ( we can define what methods should be there in the class, but not the definition of the method). These incompletly defined classes are called as Abstract Class. These incompletely defined classes are also very useful like completely defined classes. We cannot create an instance of an Abstract Class (ie intansiated), but with inheritance, abstract class enforces the derived class to have an implemention of methods that are declared abstract in base class.
A method with only method header and with no method body is called as Abstract Method. A method with a method header and a method body is called as Concrete Method.
In abstract Class you can specify the method with only method header like in the following example
public abstract class BankAccount
private string name;
public void PrintName() // Concrete Method
public abstract void printAccountType(); // Abstract Method
In the above class, note that the class is also declared abstract. Whenever a class contains one or more abstract methods, then the class should be declared Abstract. It is not necessary that an abstract class should only contain abstract methods. It can also contain Concrete methods.
The methods which donot have a definintion (or method body) is defined using the keyword abstract as in the above example.
The derived class of abstract class should have a method implementation that are declared abstract in base class. For exampe
public class SavingsAccount : BankAccount
public override void printAccountType()
Console.WriteLine(" This is a savings account ");
Note : If the derived class does not provide concrete implementation of all the abstract methods that it inherited from the abstract class, the derived class will still be an abstract class. Only when the derived class provides concrete implementation of all the methods from the abstract class, can it be intantiated.