C#C
C#3y ago
6 replies
_skimi

❔ Field initialization

Good day everyone. I wanted to know what is the difference between field initialization in the class constructor and outside the constructor. I needed to know which fields would be initialized first in the constructor or after the constructor. As a result, I had to look at the IL code. It turns out that the fields that are located behind the constructor are initialized first than the fields located in the constructor?
Screenshot_1.png
Screenshot_2.png
Was this page helpful?