Question 8919 – ISRO CS 2020
December 28, 2023GATE 2003
December 28, 2023OOPS
Question 64 |
Which one of the following is correct, when a class grants friend status to another class?
The member functions of the class generating friendship can access the members of the friend class. | |
All member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship. | |
Class friendship is reciprocal to each other. | |
There is no such concept. |
Question 64 Explanation:
→ When a class grants friend status to another class all member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship.
→ Although the entire second class must be a friend to the first class, you can select which functions in the first class will be friends of the second class.
→ Although the entire second class must be a friend to the first class, you can select which functions in the first class will be friends of the second class.
Correct Answer: B
Question 64 Explanation:
→ When a class grants friend status to another class all member functions of the class granted friendship have unrestricted access to the members of the class granting the friendship.
→ Although the entire second class must be a friend to the first class, you can select which functions in the first class will be friends of the second class.
→ Although the entire second class must be a friend to the first class, you can select which functions in the first class will be friends of the second class.