In C++, trying to access private data from outside of a class throws error.…
2018
In C++, trying to access private data from outside of a class throws error. This feature is known as:
- A.
Data abstraction
- B.
Data encoding
- C.
Data hiding
- D.
Data mining
Attempted by 166 students.
Show answer & explanation
Correct answer: C
In C++, restricting access to class members using private keywords prevents external modification. This mechanism is known as data hiding, which ensures security and integrity of object state.