posted 7 years ago
Staying with the metaphor still...
Now, let's say the foreman is constructing a number of similar houses in a subdivision. That means he uses pretty much the same blueprint to build each house. Let's say a customer comes in and says, "Hey, I want my window in the living room to be taller, so I get more sunlight to come in. Can you do that?" The foreman says, "Ok, I'll get that done for you." (Let's just assume that all the paperwork and money matters are taken care of so that the change can actually be done). A few days later, the foreman calls in his window installer. He goes to his file cabinet and pulls out a generic blueprint of the kind of house in question and says, "Hey, I need you to change this window over here and make it taller. The owner wants more sunlight to come in." He points to the living room window in the blueprint. The foreman looks up at the foreman, confused. "Ok... which house do you want me to change that window on? We've got 18 houses that are following this plan. You're pointing at the plan. I need you to point me to the actual house that has the window that needs to be changed."
The window guy just threw a "Non-static variable cannot be accessed from a static context" error at the foreman.
The foreman says, "Oh, right. It's the house on lot #3198."
The foreman just put an object reference (the house on lot #3198) in front of the instance variable reference (the living room window).
The window guy says, "Ok, you got it, boss."
The window guy just compiled the command successfully.
Does that make sense?