Articles → .NET → Why can't we instantiate abstract class

Why can't we instantiate abstract class











public abstract class AbstractClass {
  protected AbstractClass(int x) {
    Console.WriteLine("Abstract Constructor");
  }
}




public class DerivedClass: AbstractClass {
  public DerivedClass(int x): base(x) {
    Console.WriteLine(x);
  }
}




DerivedClass cls = new DerivedClass(10);





Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Sunday, January 11, 2015

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250