C++ Template Question:

Download Job Interview Questions and Answers PDF

What is Encapsulation in C++?

C++ Template Interview Question
C++ Template Interview Question

Answer:

The wrapping up of data and member function into an object is called encapsulation. The data is not accessible to the outside world and only those functions which are wrapped into the object can access it. An encapsulated objects act as a "black box" for other parts of the program which interact with it. They provide a service, but the calling objects do not need to know the details how the service is accomplished.

Download C++ Template Interview Questions And Answers PDF

Previous QuestionNext Question
What is Inheritance in C++?What is Polymorphism in C++?