0

can anyone tell me what is what is the constructor call when I am inheriting a abstract class and then I instantiate a child class.

eg.

public abstract class AbsParentClass
{
//having some functions.
} 

public class ChildClass : AbsParentClass
{
//having functions that over ride the functions of abstract class.
}

now If I do this

ChildClass objchild = new ChildClass();

then what would be the constructor calls ?

my confusion is abstract can not be instantiated , but when we inherit a class and instantiate a child class then base class is also instantiated, so how is this scenario handle in case of abstract classes?

Sumit
  • 2,670
  • 6
  • 28
  • 53

1 Answers1

1

Can an abstract class have a constructor?

Community
  • 1
  • 1
Mihai Oprea
  • 1,994
  • 3
  • 21
  • 38