What is data abstraction? How is it different from data encapsulation?

devquora
devquora

Posted On: Feb 22, 2018

 

Data abstraction is a mechanism of exposing only the interfaces and hiding the implementation details from the user. Encapsulation can merely be understood as wrapping up of data and methods in a capsule, which means just hiding properties and methods. Encapsulation is used for hiding the code and data in a single unit to protect the data from the outside the world. The class is the best example of encapsulation in C++. On the other hand, abstraction means showing only the necessary details to the intended user.

    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..