Multiple choice technology programming languages

A local variable in a block may be re-declared in another local block, if the blocks are disjoint.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Local variables have block scope in most languages (Java, C, C++). If two blocks are disjoint (not nested), they can each declare variables with the same name without conflict. Each variable is only visible within its own block. This is valid and commonly used.