Name Reuse
It is an error to declare a local variable within the scope of a local variable or a parameter with the same name.
{
int a = 1;
int b = 2;
. . .
int a = 3; // error!
if (a > b)
{
int b = 4; // error!
. . .
}
}
Previous slide
Next slide
Back to first slide
View graphic version