On object creation, which constructor is called first? Base or derived class in c#
Answers
Answered by
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
Math,
6 months ago
Computer Science,
6 months ago
Computer Science,
6 months ago
Computer Science,
1 year ago
Science,
1 year ago