What does the scope of a variable determine?
Explanation
Every declaration creates a name and places it in a region of the program. Outside that region the compiler does not recognize the name at all, which is why scope errors are caught before the program runs.
- A is not correct: a variable stores one value at a time regardless of where it is declared.
- C is not correct: constructors initialize an object's state; they do not define where a name is recognized.
- D is not correct: what a variable may contain is settled by its type, which is a separate part of the declaration.