Object oriented Programming - Basics

Following 4 concepts form the back bone of Object Oriented Programming:

ABSTRACTION: It is a way of managing complexity. e.g: From outside, you look at the car as a single entity; but once inside, you notice that it consists of many components e.g: seats, dashboard, steering wheel, stereo etc. These components in turn consist of many sub components and so on.
Each of these objects has its own unique behavior but you can treat them as a single entity. This concept is known as abstraction.

ENCAPSULATION: It is the mechanism that binds together code and the data it manipulates, and keeps them safe for the outside world. In JAVA, the basis of encapsulation is a CLASS. You may think of a class as a wrapper that binds together the data definitions and the functions/methods responsible to control them. An OBJECT is an instance of a class. Thus the class is a logical construct and the object has a physical reality.

INHERITANCE: It is the process by which one object acquires the properties of another object [hierarchical classification]. By use of inheritance the object needs only define those qualities that make it unique within a class (it can inherit the general attributes from its parents).

POLYMORPHISM: It is a feature that allows one interface to be used for a general class of actions. [One interface, multiple methods.] eg: A dog’s sense of smell is a polymorphic activity. If it smells of a cat it will run after its life but if it smells of food, it will salivate.

Bookmark this post: technorati Object oriented Programming - Basics delicious Object oriented Programming - Basics stumbleupon Object oriented Programming - Basics digg Object oriented Programming - Basics facebook Object oriented Programming - Basics yahoo Object oriented Programming - Basics google Object oriented Programming - Basics magnolia Object oriented Programming - Basics reddit Object oriented Programming - Basics windowslive Object oriented Programming - Basics

Tags: , ,

Related posts

1 Response to “Object oriented Programming - Basics”


  1. 1 Anonymous

    Hi! Just want to say what a nice site. Bye, see you soon.
    »

Leave a Reply




/kapil/blog is Digg proof thanks to caching by WP Super Cache!