There is almost no difference between them. Field assignment will occur inside the constructor in both cases. However, there is a difference in how this happens with respect to base class constructors. Take the following code:
class Base
{
public Base()
{
}
}
class One : Base
{
string test = "text";
}
class Two : Base
{
string test;
public Two()
{
test = "text";
}
}
In this case, the constructor of the base class will be called after the field is assigned in the class One, but before the assignment in the class Two.
source
share