In C# abstract classes are allowed to have constructors. It may not be needed as we can’t instantiate an abstract class but what is the use of constructors in it?

The answer for it is explained in below example.
  • abstract class constructors are used to instantiate class level variables
  • abstract class constructors are called from the derived class constructors
  • use base(arg list); for it
abstract class MyClass
{
    int variable;
    public MyClass(int variable)
    {
        this.variable = variable;
        Console.WriteLine("abstract class variable={0}",variable);
    }
    public abstract void aMethod();
    public int Variable
    {
        get
        {
            return Variable;
        }
        set
        {
            Variable = value;
        }
    }
}

class MySubClass : MyClass
{
    int variable;
    //calls the base class contructor
    MySubClass (int variable):base(variable)
    {
        this.variable=variable;
        Console.WriteLine("MySubClass constructor aVar={0}",variable);
    }
    static void Main()
    {
        MySubClass sc = new MySubClass(100);
        Console.WriteLine(sc.Variable.ToString());
    }
}