Computer Science, asked by mannysingh5235, 1 year ago

On object creation, which constructor is called first? Base or derived class in c#

Answers

Answered by Anonymous
0

Actually, the derived class constructor is executed first, but the C# compiler inserts a call to the base class constructor as first statement of the derived constructor. So: the derived is executed first, but it "looks like" the base was executed first. As others have said, the base constructor gets called first.

Similar questions