The name of default access specifier for the member function or data members…

2026

The name of default access specifier for the member function or data members in the C++ is:

  1. A.

    Protected

  2. B.

    Depends on compiler

  3. C.

    Public

  4. D.

    Private

Attempted by 103 students.

Show answer & explanation

Correct answer: D

In C++, the default access specifier for data members and member functions defined within a class is private. This means they are not accessible from outside the class unless explicitly declared as public or protected.

Explore the full course: Dsssb Tgt Computer Science Paper 2