Object Oriented Programming In the case of the object oriented
programming,we have the concept of classes and objects.
It is the way of doing programing.it is a very power full way of doing programing
The class defines the general category and the object is the
instance or occurance of the class.
Diagram explaining
the classes & objects
Features of Object Oriented Porgramming
1. Encapsulation
2. Data Abstraction
3. Data Hiding
4. Inheritance
5. Polymorphism
1. Encapsulation :
The process of binding the data items as well as the code
which manipulate these data items into a single entity is known as encapulation
and that entity is known as the class.
2. Data Abstraction :
As we know that the class contains the data items as well
as the methods or function which
manipulate these data items. But , if we want to access any of the memeber of
the class , we have to first create the object of that class.
Without
object we cannot access any of the member of the class.
3. Data Hiding :
As we know that in order to access any of the member of
the class, we have to first create the object of the class.
But sometimes even by making use of the object of the
class , we are not able to access some member.
This is due to data hiding .
And the
Data hiding is made possible due to the access control specifiers .
*
Private
*
Public
*
Protected
* Private : The elements or the members which are defined as private cannot be accessed by the object of the class.
*
Public : The elements or the members which are defined as public are
accessed directly by the object of the class.
4. Inheritance :
The
process of creatinga new class on the basis of the existing class is known as
Inheritance.The existing class
is known as the base class and the new class is known as the derived
class.
The derived
class will have more or less all the properties of the base class and some
of the properties of its own.
5. Polymorphism
The term
poly means many and morphism means forms and the concept of the
polymorphism is to use the singly
entity for the variety of different purposes.
In
C++ , polymorphism is implemented through,
*
Function Overloading
* Virtual Functions.
Starting with the C++ Programming :
No comments:
Post a Comment