Saturday, October 1, 2011

what is oops?


object oriented programming


object oriented programming(oop) is used to build oops. objects are the basic building block of object oeiented 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.
Ee     encapsulation
ab    abstrraction
in     iinheritance
po   poly morphism
Encapsulation:
Encapsulation implies that the non-essential details of an object are hidden fronm the user and an access is provided to its essential details. therefore, encapsulation is also information hiding.
For examplewhen  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 enca0psulation feature . encapsulation hides the irrelavant details of an object and abstraction makesonly relavant 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. interms of  classes and objects,attributes refer to the data  and behavior refer to methods.

Polymorphism:
polymorhism is derived from lathin words poly, which means many, and morph, which means forms.  Any thing that exists in more than one form is known as polymorph.
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.




No comments:

Post a Comment