C# is quite nit-picking when it comes to variable scoping. How is it possible that it accepts this code:
class Program
{
int x = 0;
void foo()
{
int x = 0;
x = 1;
Console.WriteLine(x);
}
}
If you ask me, that's an obvious naming conflict. Still the compiler (VS 2010) accepts it. Why?
Thats normal.
In constructors I often use the same.
Else it would be not possible to declare method parameters which are named like member variables.