If Class B Inherits Class A Privately And Class B Has A Friend #206
If class B inherits class A privately. And class B has a friend function. Will the friend function be able to access the private member of class A?
This multiple choice question (MCQ) is related to the book/course gs gs111 OOP Object Oriented Programming Java. It can also be found in gs gs111 OOps Access Specifiers - OOPs MCQ: Access Specifiers - Quiz No.2.
If class B inherits class A privately. And class B has a friend function. Will the friend function be able to access the private member of class A?
Yes, because friend function can access all the members
Yes, because friend function is of class B
No, because friend function can only access private members of friend class
No, because friend function can access private member of class A also