💻ap computer science a review

Variable shadowing

Written by the Fiveable Content Team • Last updated August 2025
Verified for the 2027 exam
Verified for the 2027 examWritten by the Fiveable Content Team • Last updated August 2025

Definition

A situation where a local variable or parameter with the same name as an instance variable causes the local variable to be referenced instead of the instance variable within the constructor or method body.

AP course connection

Topic 3.8: 3.8 Scope and Access

Unit 3

"Variable shadowing" also found in: