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:

Answer: C. Data hidingIn C++, restricting access to class members using private keywords prevents external modification. This mechanism is known as data hiding, which ensures…

  1. A.

    Data abstraction

  2. B.

    Data encoding

  3. C.

    Data hiding

  4. D.

    Data mining

Attempted by 426 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: Dsssb Tgt Computer Science Paper 2

Loading lesson…