Simply speaking, polymorphism is the ability of something to be displayed in multiple forms. Let’s take a real life scenario; a person at the same time can perform several duties as per demand, in the particular scenario. Such as, a man at a same time can serve as a father, as a husband, as a son, and as an employee. So, single person possess different behaviors in respective situations. This is the real life example of polymorphism. Polymorphism is one of the important features of Object Oriented Programming (OOP).
The goal of these columns is to explore object-orientation through practical object-oriented programming. This time, we look at C++, but in the future we will explore other areas of object-orientation. Learning an object-oriented language-a whole new way of programming-will pave the way for many exciting topics down the road.
Any program which uses these five methodologies or any of it, we can call that program object oriented. They are Encapsulation, Data Hiding, Overloading, Polymorphism, Inheritance. Any programming language which supports all of these features and facilitate the programmer in developing the program in these methodologies is called Object Oriented Programming Language i.e. C++, Java, C#.
A class is an organisation of data and functions which operate on them. Data structures are called data members and the functions are called member functions, The combination of data members and member functions constitute a data object or simply an object.
This is a very basic C++ program that demonstrates data protection in a very simple way. Data protection in Object Oriented Programming is controlling access to all attributes is one of the most important concepts of object-oriented design