- Get link
- X
- Other Apps
Encapasulation in c++ :- It is defined as when you wrap and bind all related data together in a single form or in a single unit or you can defined as binding of data together and manipulating it are called encapasulation in C++ . For Example : If there is a three department in a company are Finance , sale , research department finance department handle all finance related data and sales department handle sale related data if finance department needs information about any other section they need permission of head of the department to access it this called encapasulation . this also lead data abstraction or data hiding #include <iostream> using namespace std; class container { private: // data hidden from outside world int x ; public: void given ( int a) { ...