Explain what data encapsulation is in C++?

devquora
devquora

Posted On: Feb 22, 2018

 

Data encapsulation is a mechanism of bundling the data and the functions that use them where the implementation details of a class are kept hidden from the user. With this, the user can only perform a restricted set of operations on the hidden members of the class by executing special functions, which are also commonly known as methods. This vital concept of object-oriented programming is also often used to hide the internal representation, or state, of an object from the outside world.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What is ‘this’ pointer?

    The ‘this’ pointer is passed as a hidden argument to all the non-static member method calls and is available as a l..