Friday, May 4, 2018

OBJECT ORIENTED PROGRAMMING

First thing, which I will say about any computer program is that, any program consists of data and the functions operated over data.
Object oriented programming is programming approach where both data and functions (operations) of program  is considered into a single and combine unit.
--------------------------------------------------------- 
Why we combine both Data and Functions
--------------------------------------------------------
The first thing behind this is to provide security to data i.e. data must be accessed by functions of program only and nowhere else.
To achieve this we declare data as private(This is termed as data hiding). 
The second thing is abstraction. Abstraction is the process of hiding how functions are implemented and providing a medium/way to access these functions.

The above two is possible only, if we think a program as bundle of data and operations over data. This program bundle is called an object.

To achieve power of object oriented technique, we should better understand classes and objects. Classes and objects are very basic to understand as beginner in oops.

Concept Class and its Objects-
---------------------------------------

To understand what a class is, lets take an example, suppose a company want to manufacture mobile and also suppose there is no mobile present right now. Company conducts a meeting with their staff members and discuss about Mobile. While discussion the features of  mobiles are told to every one. The properties and behaviors of mobile is  told.


2 comments: