Multiple choice technology programming languages

Consider 3 classes A,B,C. A's child class is B, B's child class is C. Inheritance hierarchy is A->B->C. You write in Main(), C obj = new C(); In what order are the constructors called?

  1. B, C

  2. C, B and A

  3. A, B and C

  4. Object, A, B and C

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In C#, constructor execution starts from the highest base class in the inheritance hierarchy down to the derived class. Since all classes implicitly inherit from System.Object, its constructor runs first, followed by A, B, and finally C. Distractors fail to include Object or list the execution order in reverse.