explain the following term with example C++ abstraction and polymorphism
Answers
●explain the following term with example C++ abstraction and polymorphism●
Polymorphism in C++
Polymorphism in C++C++ polymorphism means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function. Consider the following example where a base class has been derived by other two classes −
☆Extra Note :--☆
Abstraction means displaying only essential information and hiding the details. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. Consider a real life example of a man driving a car.
Explanation:
Abstraction in C++
Abstraction means displaying only essential information and hiding the details. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. Consider a real life example of a man driving a car
Polymorphism in C++
C++ polymorphism means that a call to a member function will cause a different function to be executed depending on the type of object that invokes the function