You must define the variable before use in C #. Of course, the compiler could detect when it reaches
a = 1;
That a is not yet defined and therefore defines the variable and assigns it a value of 1. However, this can lead to other problems that you have:
MyOwnClass myVeryLongVariableNameThatIsUsedAllOverThePlace = new MyOwnClass(); myveryLongVariableNameThatIsUsedAllOverThePlace = input.GetNewClass();
Now you have 2 variables in which you thought you had.
source share