Could anyone explain me the following C# sample code?
public class MyTestClass
{
private int x = 100;
private int y;
public MyTestClass
{
y = 200;
}
}
I understand that when MyTestClass is instantiated, the constructor gets called and y is assigned the value 200. But what happens in case of x? When is 100 actually assigned to x? Should I imagine this as if x were in the constructor and got its initial value there?