In This Chapter
Recognizing objects so that you can create classes
Encapsulating classes into self-contained capsules
Building hierarchies of classes through inheritance
Step outside for a moment and look down. What is the thing you are standing on? (Hint: It’s giant, it’s made of rock and sand and stone and molten lava, and it’s covered with oceans and land.) The answer? A thing! (Even a planet is a thing.) And now go back inside. What’s the thing that you opened — the thing with a doorknob? It’s a thing, too! It’s a slightly different kind of thing, but a thing nevertheless. And what are you inside? Okay, you get the idea. Everything you can imagine is a thing — or, to use another term, an object. Remember that word: object.
Over the years, researchers in the world of computer programming (now, doesn’t that sound like an exciting job?) have figured out that the best way to program computers is to divide whatever it is you’re trying to model into a bunch of objects. These objects have capabilities and characteristics. ...