I have the following code, who can explain what is the meaning of “= -0” at the end of the “state” property definition?
public class Subject
{
public int State { get; set; } = -0;
}
It’s just the initial value of the property. It’s very odd to write -0
for an integer, particularly as zero would be the default value anyway, but it’s still valid.
That’s basically equivalent to:
public class Subject
{
public int State { get; set; }
public Subject()
{
State = -0;
}
}