The default access level assigned to members of a class is ___________

  1. Public

  2. Protected

  3. Private

  4. Default


Correct Option: C
Explanation:

To solve this question, the user needs to know the concept of access modifiers in object-oriented programming and their default level assigned to the members of a class.

Now, let's go through each option and explain why it is right or wrong:

A. Public: This option is incorrect. Public access modifier allows members of a class to be accessible from anywhere in the program. However, it is not the default access level assigned to members of a class.

B. Protected: This option is incorrect. Protected access modifier allows the members of a class to be accessible within the class and its subclasses. However, it is not the default access level assigned to members of a class.

C. Private: This option is correct. Private access modifier allows the members of a class to be accessible within the class only. It is the default access level assigned to the members of a class if no other access modifier is explicitly specified.

D. Default: This option is incorrect. Default access modifier allows the members of a class to be accessible within the package only. It is not the default access level assigned to the members of a class.

The Answer is: C

Find more quizzes: