[Solved] If a is true then what will happen to y? does y gets declared? [closed]


If a is true, then y never exists — it only comes into existence after execution enters the block in which it’s defined, and if that never happens it never exists at all.

Whichever leg of the if statement is executed, the variable(s) defined in that scope are destroyed when execution leaves that scope, so after the end of this code, neither x nor y exists, so neither can be used at all.

0

solved If a is true then what will happen to y? does y gets declared? [closed]