Which of the following language feature is not an access specifier in C++?

  1. Public

  2. Private

  3. Protected

  4. Internal


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of access specifiers in C++.

Access specifiers in C++ are used to define the visibility and accessibility of class members (variables and functions) within a class or from outside the class. There are three access specifiers in C++: public, private, and protected.

Here is an explanation for each option:

Option A) Public - This option is a valid access specifier in C++. Public members are accessible from within the class, as well as from outside the class.

Option B) Private - This option is a valid access specifier in C++. Private members are only accessible from within the class.

Option C) Protected - This option is a valid access specifier in C++. Protected members are accessible from within the class and its derived classes.

Option D) Internal - This option is not a valid access specifier in C++. "Internal" is not an access specifier in C++. It is not used to define the visibility or accessibility of class members in C++.

The correct answer is option D) Internal. This option is not an access specifier in C++.

Find more quizzes: