Explain in detail about the concepts of object oriented programming ?
The concepts of object oriented programming are:-
1. Class and Object.
2. Encapsulation.
3. Data abstraction.
4. Polymorphism.
5. Inheritance.
6. Dynamic binding
7. Message passing
1. CLASS AND OBJECT :-
A Class is a user-defined data type holding variables and member function together, which can only be accessed by using object .
where as
Object are created from Classes. A declaration of object is made in the same way as we make a declaration of variables. Object can also be defined as real - world entity existing physically in the world with same behavior and state.
2. ENCAPSULATION :-
The wrapping of data and function together as a single unit is known as encapsulation . By default data is not accessible to outside world and they are only accessible through the function which are wrapped in a class, prevention of data direct access is called data hiding information hiding .
3. DATA ABSTRACTION :-
Abstraction refers to the act of representing essential features without including background details and explanation. Classes are the concepts of abstraction and are defined as a list of attributes such as size , weight , cost and function to operate on these attributes. They encapsulate all the essential properties of the object that are to be created.
4.POLYMORPHISM :-
'Poly' means many and 'morphism' means forms i.e many forms. Polymorphism means the ability to take more than one form. For example an operation different behavior in different instances . A behavior depends upon the type of data used in the operation. Different ways to achieve polymorphism in c++ program:-
i) Function overloading .
ii) Operator overloading.
5. INHERITANCE :-
Inheritance is the process by which one object can acquire the property of another .Inheritance is the most importance concept of OPPs which helps realize the goals of constructing software from reusable parts .
When the class child inherits the class parents, the class child is referred as derived class which is also known as sub class and the class parents is referred as sub class which is also known as super class. In this class the class child are two types a derived part and incremental part. The derived part derived from class parent and the incremental part inherits from derived class.
6. DYNAMIC BINDING :-
Binding refers to linking of procedure call to the code to be executed in response to the call . Dynamic binding (or late binding) means the code associated with a given procedure call is not known until the time of call at run time.
7. MESSAGE PASSING :-
An object oriented is a set of object that communicating with each other . An object communicate with each other by sending and receiving information . A message for an object is a request for execution of a procedure and therefore invoke the function that is called for an object and generate result .
I HOPE THIS INFORMATION IS HELPFUL TO YOU.