Lesson 17 of 24
InheritanceInheritance
10 min 35 XP
class Car : public Vehicle என்றால் Car, Vehicle-ன் public மற்றும் protected உறுப்புகளைப் பெறும். Derived constructor, base constructor-ஐ initializer list-ல் அழைக்கும். C++ multiple inheritance-ஐயும் ஆதரிக்கிறது.
class Car : public Vehicle gives Car the public and protected members of Vehicle. The derived constructor calls the base constructor in its initializer list. C++ even supports multiple inheritance.
Example: edit me and press Run
Press Run to see the result here.