๐Ÿ’ปap computer science a review

Static variable

Written by the Fiveable Content Team โ€ข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโ€ขWritten by the Fiveable Content Team โ€ข Last updated September 2025

Definition

A static variable is a class-level variable that belongs to the class itself, rather than any specific instance of the class. It is shared by all instances of the class and can be accessed without creating an object of the class.

"Static variable" also found in: