I was wondering what the fundamental difference is between C# scope rules of local variables and Java's. I know there is a difference, but I can't figure it out. Here is the scope rule from the C# language definition:
"The scope of a local variable declared in a local-variable-declaration is the block in which the declaration occurs. It is a error to refer to a local variable in a textual position that precedes the variable declarator of the local variable."
"The scope of a local variable declaration in a block (§14.4.2) is the rest of the block in which the declaration appears, starting with its own initializer (§14.4) and including any further declarators to the right in the local variable declaration statement. "
It seems to me that the only difference is that Java states more explicitly that a local variable can be seen later in the variable declaration statement. I don't see how the C# definition would exclude the variable declaration statement, but that is the only difference I can see.