What does a static variable belong to?
Explanation
This is the single idea the rest of the topic builds on. Deciding whether a value belongs to the class or to each object comes down to one question: does the program need one copy or many?
- A is not correct: a separate copy per object describes an instance variable, which is the other kind.
- B is not correct: a parameter is a separate variable that exists only for the duration of one call.
- C is not correct: a variable tied to a block is a local variable, and it disappears when that block ends.