Principles of Object oriented programming:
ü
Objects:
i.
Objects are basic runtime entities
in an object oriented system.
ii.
In Structured programming problem
is divided into function unlike this, in OOPs the problem is divided into
objects.
Diagram
ü
Class:
Language supports different data type like int, float, char,
long, structure etc. Similar to that C++ supports class data type. A class data
type contains variable and functions. They can be accessed through class
variables (Objects).
For Ex:
Fruit is a class.
Then mango, orange will be objects of class.
ü
Inheritance:
It is a process by which object of one class acquire the
properties of object of another class. The concept of inheritance provides the
idea of reusability. This means that we can add additional features to an
existing class without modifying it. This is possible by deriving a new class
from the existing once.
The new class will have the combined feature of both the
classes.
ü
Abstraction:
It is referred to the act of representing essential feature
without including background detail or explanation. Class use the concept of
abstraction and are defined as abstract attributes such as size, weight and
cost.
ü
Encapsulation:
The wrapping of data and functions into a single unit (class)
is known as encapsulation.
The data is not accessible to outside world and those
functions which are wrapped into the class can access it.
It is also known as data hiding.
ü
Polymorphism:
It means use one thing in more than one form. Operator
overloading & function overloading are examples of polymorphism.
·
Function Overloading:
The function name has more than one definition in a class
according to arguments passed to a function.
·
Operator Overloading:
Uses
predefined operators as function name and allow giving it new definition.
0 comments:
Post a Comment