Question 135

In C++, a friend function of a class can:

  1. ABe inherited by derived classes
  2. BOnly access public members
  3. CNot be a non-member function
  4. DAccess its private and protected members
Show answerHide answer

Correct answer: (D) Access its private and protected members

Explanation

Friendship grants access to private/protected members.

From DSSSB TGT Computer Science Full Mock Test 2

This is question 135 of DSSSB TGT Computer Science Full Mock Test 2. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.