4.3k views
2 votes
Which of the following statements about inheritance is true if memberAccessSpecifier is protected? a. The derived class can directly access any member of the base class. b. The private members of the base class become protected members of the derived class. c. The protected members of the base class become private members of the derived class. d. The public members of the base class become protected members of the derived class.

1 Answer

5 votes

Answer:

The correct answer to the following question is (d).

Step-by-step explanation:

Because member access specifier is protected when a public member of the superclass becomes the protected member of the subclass.

  • Protected is the keyword which is the access modifier use with the class members or the class.
  • Protected is defined before the name of the class or before the name of the class members such as the data members and the member functions or methods.
User Jan Tojnar
by
5.4k points