Question #8: Given the code below, the variable y can be accessed in which blocks of code?
Question #8: Given the code below, the variable y can be accessed in which blocks of code?
|
|
lines 4-15 | |
lines 4-17 | |
lines 8-11 | |
lines 8-15 - correct | |
lines 8-17 | |
description: The variable declared in the else-if did not exist before its declaration and can not be used after the end of the else clause. Variables declared in conditions of if,else-if,else structures can be used in all subsequent conditions and bodies of the if,else-if,else structure. |