A Bit About Objects, Class, Inheritance

What is an Object?

Objects used in programming are a bit like objects in the real world.  Physical objects have two characteristics: the state they are in (i.e., their properties or attributes)  and the behaviors they can perform. 

Consider a CD player.  Its state may consist of things like:    

Title of CD currently loaded
Track number
Volume setting
Playing/Paused/Stopped

Likewise, its behaviors may include:

Load a CD
Skip forward
Skip backward
Change volume
Play/Pause/Stop

Pictorially this could be represented as follows:

More...

No comments:

Post a Comment