Your last block of code without if/else if will be executed. Curly braces are intended to separate code and do not require conditional / iteration or any other predecessor to make sense.
To exaggerate, to further explain my thought:
{ { Console.WriteLine("This works"); int i; } // the variable i is out of scope and can't be referenced here }
It is also possible.
According to a comment by @slugonamission , he brought up a wonderful moment. A code block also creates an area allocation for variables that are created inside this code block.
user596075
source share