Re: PHP Classes For Beginners What is inheritance?
Probably the greatest feature of the PHP OOP model is Inheritance. Inheritance is the ability of PHP to extend classes (child classes) that inherit the characteristics of the parent class. The resulting object of an extend class has all the characteristics of the parent class, plus whatever is in the new child, or extended class. In this instance we will extend the vehicle class and add a motorcycle. A motorcycle is still a vehicle and shares many of the same attributes such as price, drive etc. But a motorcycle has some unique features that a car does not.
__________________ Thanks & Regards, Jegan CBK "We will either find a way, or make one!” |