Before going into the details of “object oriented programming” let us understand very basic fundamental. look at these three word “object”,”oriented” and “programming”. But should we start learning “OBJECT” concept or do we need something else?. Yes before going into the details of objcet we should consider about “CLASS”.  The world need this word because it provides  a name of related objects. There are so many types of fruits in this world like apple,mango,banana etc. but these all are fruit. so fruit is class and mango is one of object of fruit.

“A class is not an Object. A class is blue print of an object”

C++ is object oriented programming. object consists of data and method that operate on the data. This is the basic unit of object oriented programming.

FEATURES OF OOP:

  1. Data Hiding(Abstraction) and Encapsulation
  2. Dynamic Binding
  3. Message Passing
  4. Inheritance
  5. Polymorphism

ENCAPSULATION:

Combining data and function in single unit is called encapsulation. ex.

class  Addition {
   int a;
   int b;
public:
    void add( int a,int b);
}

Here Addition is a class.,a,b is data and void add(int a, int b) is function. The class Addition is encapsulating data and function. so class is providing a way of encapsulation in object oriented programming.

DATA ABSTRACTION:

Data is not accessible from the outside world and only those function which are present in the class can access the data. The insulation of the data from direct access by the program is called data hiding or information hiding. Hiding the complexity of proram is called Abstraction and only essential features are represented.

DYNAMIC BINDING:

Resolving function at runtime is called dynamic binding.

MESSAGE PASSING:

The process by which one object can interact with other object is called message passing.

INHERITANCE:

In object oriented programing inheritance is mechanism of  extending a class. it creates a new class called derived class from base class. The derived class inherits all the properties of base class. it can modifies some of features of base class or may add new features.

POLYMORPHISM:

Polymorphism is an ability to take more than one form. In object oriented programming.



Related Contents to follow