There are different ways of initializing a field. You can either initialize it inline or set an appropriate value in the constructor. Doing both results in loss of value as the constructor overwrites any previously assigned value. It is therefore recommended that you choose any one of the appropriate ways of initializing a field.
class C
{
private int v = 1;
public C()
{
// ...
v = 2; // Previous value `1` is lost!
}
}
class C
{
private int v;
public C()
{
// ...
v = 2; // No longer initialized inline
}
}