C++ Laguage



Admission Enquiry Form

  

Features of OOPs in C++



What is OOP(Object Oriented Programming) ?

OOP means in which we write the programs in the form of objects.

So now important is to know about what is object?

Object is something in real world that physical exists. Like Table,chair,pen,board,teacher,student and so many.

Main features of OOP.

  1. Encapsulation
  2. Abstraction
  3. Inheritance
  4. Poly-Morphism




Encapsulation:

First we need to know about the meaning of Encapsulation.You should find the dictionary meaning of Encapsulation. So the meaning of encapsulation is to bind together. Now in the program, what we can bind together? We know in program we have data and code. So encapsulation means binding together data and code. Here data refers to variables and code referes to functions.

Encapsulation means putting together data and code in single unit so that it can be managed and organised easily.




Abstraction:

The meaning of abstraction is hiding complexity of anything.In real world abstraction is available in each and every object.Like we drive car so we know just about break,stearing,cluch and little bit more but we don't know about the working of the car engine still we use the engine without knowing the working of the car engine.This is abstraction in car.Using the car without knowing the working of the car or the complexity of the functionality of the car or car engine. Because the customer or the user is not interested to know about the functionality or the complexity of the car that how car is working? User is interested only to use the product not in how the product is working so now the same is requird to implement in programming also and that is known as the Abstraction in Programming.

Encapsulation means hiding the complexity and to share only the essential features.

Encapsulation in object oriented programming means hiding the data or the functions which are not directly required by the user




Inheritance:

First we need to know about the inheritance in the Real World. Try to relate the Programming concepts to the real World then it becomes easy to understand the programming concepts.The only big job is to relate the programming concept to the real World.Inheritance in real world is the process to create new object by using the features of the existing object or the extension of the existing object.Simply we can say the new version of the old object or the provision to create the new one from the existing one without working again from the scratch while creating new.

Inheritance is the process to create the new objects by adding the properties or functions from the existing object

In C++ inheritance is of following types:

  1. Single Inheritance
  2. Multilevel Inheritance
  3. Multiple Inheritance
  4. Hierarchical Inheritance
  5. Hybrid Inheritance



Polymorphism

Polymorphism means many forms

We need to understand the polymorhism in the real world.Polymorphism means the utilization of same resources to do many jobs by adding little bit resources. Like mobile phone can be used to make calls as well as for taking photos listening music and for many more.So the one mother board of the phone can be used as mobile phone or as camera also by just adding camera to the mobile phone.This is the utilization of the resources to perform more than one job by using the same resources.This is beneficial for the customer as well as for the manufacturer as cost cutting.So the customer getting mobile phone,camera musica player at the cost of one product.This is known as polymorphism

In Programming Poly morphism is defining more than one functions of same name with different arguments.We will understand this better when we will go for practical sessions.