Multiple choice technology programming languages

A local variable with the same name as an instance variable

  1. shadowing

  2. Coupling

  3. Cohesion

  4. None of the above

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

Variable shadowing occurs when a variable declared within a specific scope has the same name as a variable in an outer scope. The local variable takes precedence, hiding the instance variable within that scope.