Advertisement

Object oriented Programming in C++ | Mohd Abuzar

 Through this  video we are learning about the Oops concept in C++

https://abuzartec.blogspot.com/2021/05/object-oriented-programming-in-c-mohd.html

Types of Oops Concept in C++

  1. Introduction 
  2. Class
  3. Object 
  4. Encapsulation 
  5. Abstraction 
  6. Polymorphism 
  7. Inheritance 
  8. Dynaic Binding 
  9. Message Passing
Object oriented programming :-  The major purpose of c++ programming is to introduced concept of orientation in the C programming . object oriented programming is a paradiagram that provides a many concept Like , Inheritance , Polymorphism , Encapsulation Etc . 

Object oriented programming where everything can be represented in Object is known as truly object-oriented programming . 


Classes :-  Class is a like a building blocks in C++ , and it is user defined data type , which holds it's own data member and member functions , it can be accessed and used by creating an instant of that class . A class is like a blue print of an object .


For Example :-  Consider the class of car , there are be many cars , names and brand but all of them share some common properties like all of them have 4 wheel and etc . and here car is the class and wheel are their property .

  • A Class is user-defined data member and member  function 
  • Data member is a data function are the function used to manipulate these data member and data function defined the properties and behaviour of the Object .

Object :-  Object identify  some charcterstic and behaviour . and object is a instant of class . When the class is defined no memory can be allocated whenever objct is not initilize .


Example :

class person {

  char name[20];

  int id;

public:
void getdetails(){}
};
int main()
{
 person p1; // p1 is a object 
}

Encapsulation :- Encapsulation is defined as wrapping of data and Inforamation using a single Unit . In object-oriented programming encapsulation is defined as binding the data together and the function that manipulate them .

In real life example :

we are working in a company where there are so  many departments like sales department , account department and cash counter department . In some case account department is facing a problem in cash they thought that we they have direct call to the cash department so they can't do that because company can not give a chance to take the data of the account dperatment so , they give a request to the head of the company and the head requesst to the cash  department then cash  department show the record to the account department . This is the real life example of Encapslation .


Abstraction :- Data abstraction is providing to hide the data outside the world and hiding their background details , Show only needed information to the program and don't show the irrelevant data to the user.

Real life example :

Every person uses the phone but they can only see the output in the screen but not show show the processing which done in the mobiles phones so this is the real life example of abstraction where you can see only the relevant data and the don't show the processing .


polymorphism :- polymorphism means that call to member function will different function will be executed depending on the type of object that invokes the function .


Inheritance :-  Inheritance is the important features in Object oriented progamming . It allow us to create a new class ( Derived class ) From an exiting class ( Base class).


Dynamic Binding :- Dynamic binding refers to a process of Converting identifier ( Such as variable or performance name ) into address .Binding is done for each variable and function , it's mean that matching the function with the right function definition by the compilor . It takes place either at compile time or at run time . 


Message Passing :-  A request for an object  to perform one of it's operations is called a message .   operation means method / function . A message can not go automatically it's create an interface for an object   . The interface provided the abstraction  over the message mean hide the implimentation . 

All communication via done by message passing   


This article is contributed by Mohd Abuzar . If  you like code with Abuzar and would like to contribute you can also  mail at abuzar.abuzar.mohd325@gmail.com .


Please write comment if you find anything incorrect .





Post a Comment

3 Comments

  1. Replies
    1. Search C++ then the C++ all concept , theory and program are available here . Thankyou

      Delete
  2. Everthing about c++ is written above , Please read carefully to understand it .
    Thankyou

    ReplyDelete

Do not Comment and any spam text