C/C++ProgramminginterviewquestionsandanswersBySatishShetty,July14th,2004Whatisencapsulation
Containingandhidinginformationaboutanobject,suchasinternaldatastructuresandcode
Encapsulationisolatestheinternalcomplexityofanobject'soperationfromtherestoftheapplication
Forexample,aclientcomponentaskingfornetrevenuefromabusinessobjectneednotknowthedata'sorigin
Whatisinheritance
Inheritanceallowsoneclasstoreusethestateandbehaviorofanotherclass
Thederivedclassinheritsthepropertiesandmethodimplementationsofthebaseclassandextendsitbyoverridingmethodsandaddingadditionalpropertiesandmethods
WhatisPolymorphism
Polymorphismallowsaclienttotreatdifferentobjectsinthesamewayeveniftheywerecreatedfromdifferentclassesandexhibitdifferentbehaviors
Youcanuseimplementationinheritancetoachievepolymorphism