Solved

What Happens When Two Blocks, One Nested Inside of the Other

Question 47

Multiple Choice

What happens when two blocks, one nested inside of the other, both declare variables with the same identifier? (Assume that the outer block declares its variable before the opening left-brace of the inner block.)


A) A syntax error occurs.
B) The "outer" variable is hidden while the "inner" variable is in scope.
C) The "outer" variable is irretrievably lost when the "inner" variable is declared.
D) The "inner" declaration is ignored and the "outer" variable has scope even inside the inner block.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions