Introduction
Object oriented programming(oop) is used to
build oops. objects are the basic building block of object oriented programming
system(oops)
The real world objects have two
characteristics: state and behavior.
For example human beings have state such
as name, color, age, and height and behaviors such as walking, dancing and
sleeping.
Oops consists of following
features.
Encapsulation
Abstraction
Inheritance
Polymorphism
Encapsulation:
Encapsulation implies that the non-essential
details of an object are hidden from the user and an access is provided to its
essential details. therefore, encapsulation is also information hiding.
For example when you switch on the TV
the TV starting showing movies. you don’t have to know what is happening in the
internal electrical circuits and cathode ray tube and that is hidden from the
viewer
Abstraction:
In object oriented, programming, abstraction
means ignoring the non essential; details of an object and concentrating on
essential details.
To implement abstraction , you also use the
encapsulation feature . encapsulation hides the irrelevant details of an object
and abstraction makes only relevant features of an object visible.
Inheritance:
In object oriented methodology , inheritance
enables you to extend the functionality of an existing class. you
create a class inherits attributes and behavior of another class. in addition ,
a new class can consist of a few new attributes and behavior that are specific
to the class. In terms of classes and objects, attributes refer to the
data and behavior refer to methods.
Polymorphism:
Polymorphism is derived from lathin words
poly, which means many, and morph, which means forms. Anything that
exists in more than one form is known as poly morph.
In object oriented methodology, polymorphism
is the feature that enables you to assign a different meaning or usage to
an entity in different contexts. the entity can be a variable, method, or
an object. Polymorphism enables an entity to have more than one form depending
upon the context in which it is used.