THE IDEA OF classes leads to the idea of inheritance.In our daily lives we use the concepts of classes being devidee in to the sub classes. we know that the class of vehicles is devidedin to cars,truck,buses and motorcycle.The princioes in the sort of division is that thesub classes shares common characterstics with the class from which it is derived.
cars,trucks,buses,motorcycle they have motor and wheels these are definding characterstics of vehicles.In addition the characterstics shared with other meembers of class ,each sub class also has its own particular characterstics.For instance buses have many more seats for many people to sit it ,while truks have space for hauling heavy loads in similar way an OOP class can be devided in to sub classes .Inthe C++ the original class called the base class other classes can be defined that share its characterstics but add their own well.there are called derived classes.
Friday, August 7, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment