Thursday, July 9, 2009

What are real time examples of Inheritance, Polymorphism ,Encapsulation , Virtual functions in c++?

What is "Real Time Example"? In a technical interview what should one say when asked the above question?

What are real time examples of Inheritance, Polymorphism ,Encapsulation , Virtual functions in c++?
Encapsulation is the mechanism that binds together


code and data it manipulates and keeps both safe from outside interface and misuse.





Inheritence is the process by which one object acquires the properties of another object.





Polymorphism is the feature that allows one interface to be used for general class actions.





Creating a pure virtual function allows you to put a member function in an interface without being forced to provide a possibly meaningless body of code for that member function. At the same time, a pure virtual function forces inherited classes to provide a definition for it.





A real life example can be found via the link below.
Reply:yesh, let be friend!


No comments:

Post a Comment