Tuesday, December 7, 2010

Object Oriented Programming

Object Oriented Programming uses objects together with their interaction to design computer applications. It uses data structures consisting of data fields and methods. Where, Data fields are the data encapsulated within a class and Methods are a sequence of programming statements to perform a specific action or task.

Object is a member of a class. An object of a given class is called an instance of the class. Instance refers to any running process. Class is used as a template to create objects of that class. The template describes the state and behavior that the objects of the class share.

In real world whatever we see or with whatever we interact are objects like a man/women, a cycle or a bike …. etc. Every object have a theoretical background, the theory(class) is first designed in order to create objects.

As an Example consider a factory making registers or books. For this purpose it will create a class/theory first which will contain every detail about the register. Now depending on this single class it will create like 1000 registers (objects).

Three basic pillars of Object Oriented Programming are :
- Encapsulation
- Inheritance
- Polymorphism

No comments:

Post a Comment