I know that the following is the order of data members initialization and constructor call when creating a derived class object.
- Derived static fields
- Derived static constructor
- Derived instance fields
- Base static fields
- Base static constructor
- Base instance fields
- Base instance constructor
- Derived instance constructor
Everything here seems pretty logical except for ONE thing:
I can not understand why is that that derived class fields get initialized before base class fields? Honestly I can not find any valid and logical explanation for that after scouring the internet and giving it a lot of thought.