Explaining static variables

I think it’s a good thing that people educate themselves in computer science. That’s one of the reasons I try to keep in touch with KTH and the students there. I used to work with helping new students learn programming in Java.

One of the most common questions I meet is “What does static mean?”.

Last night me and my girlfriend, whom is into testing, went out for dinner (for her birthday). After a few glasses of wine we found a way to describe static variables that we really liked.

“Everyone around us are implementations of the Person class. A person has an Age property. If the Age property would be static, then everyone would have the same age.”

I like it because I can imagine the movie explanation where everyone around you would change to the same age.