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:

  1. A.

    Data abstraction

  2. B.

    Data encoding

  3. C.

    Data hiding

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

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs