Limit the life and the scope of variables by using { } brackets.
string str1 = “1”;
{string str2 = “3”; Console.Write(str2);}
Console.Write(str2);
str2 only lives within the brackets
Limit the life and the scope of variables by using { } brackets.
string str1 = “1”;
{string str2 = “3”; Console.Write(str2);}
Console.Write(str2);
str2 only lives within the brackets