study guides for every class

that actually explain what's on your next test

Local Variable

from class:

AP Computer Science A

Definition

A local variable is a variable that is declared inside a method or block and can only be accessed within that particular method or block. It has limited scope and lifetime, meaning it only exists as long as the method or block is being executed.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.