Explain encapsulation in C++.



Explain encapsulation in C++...

Answer / Amit Kumar Rai

Encapsulation is a mechanism in C++ that binds the data and functions that manipulate the data into a single unit, called a class. This prevents direct access to the data members and forces the use of member functions, ensuring data privacy and integrity.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ Interview Questions

Write a C++ Program to find Addition of Two Numbers.

1 Answers  


What is the difference between creating an object, using 'new' and using 'malloc'?

3 Answers   HFG, Siemens,


What is a constructor initializer list?

1 Answers   Amazon,


Explain the difference between C and C++.

1 Answers   Accenture,


explain the term 'resource acquisition is initialization'?

1 Answers   Amazon,


What is data abstraction? How is it implemented in C++?

1 Answers   Amdocs,


What is constant keyword in C++? Illustrate its various uses.

1 Answers   Akamai Technologies, Infogain,


Write a program that ask for user input from 5 to 9 then calculate the average

1 Answers   IBS,


Explain function prototypes in C++.

1 Answers   Aricent,


What is the meaning of the following declaration: int *const *const *i?

1 Answers   Adobe,


How to reverse a string in C++

1 Answers  


What are the advantages/disadvantages of using #define?

1 Answers   Amazon,


Categories