arrow
arrow
arrow
Which of the following is not a member of a class?
Question



Which of the following is not a member of a class?

A.

Member function

B.

Friend function

C.

Constructor

D.

Data member

E.

None of the above

Correct option is B

A friend function is not a member of a class. It is declared using the friend keyword and can access private and protected members of the class, but it is not defined within the class scope and does not belong to the class. Instead, it is defined as an independent function.
Important Key Points:

· Friend functions are declared inside the class using the friend keyword but defined outside the class.

· Although it can access private and protected members of the class, it is not a member of the class itself.

· They can access private/protected members of the class but do not belong to the class.
· Examples of friend functions include operator overloading functions and utility functions that work with multiple classes.

Knowledge Booster:

1.Member function: These are defined inside the class and are members of the class.
2.Constructor: A special type of member function used to initialize objects.
3.Data member: Variables defined inside the class to hold data.

Free Tests

Free
Must Attempt
Video Solutions

RBI Assistant Pre 2026 Full Mock Test -01

languageIcon English
  • pdpQsnIcon100 Questions
  • pdpsheetsIcon100 Marks
  • timerIcon60 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Asst Prelims 2026 : Reasoning Section Test 01

languageIcon English
  • pdpQsnIcon35 Questions
  • pdpsheetsIcon35 Marks
  • timerIcon20 Mins
languageIcon English
Free
Must Attempt
Video Solutions

RBI Office Attendant 2026 Full Mock Test - 01

languageIcon English
  • pdpQsnIcon120 Questions
  • pdpsheetsIcon120 Marks
  • timerIcon90 Mins
languageIcon English
test-prime-package

Access ‘IBPS RRB SO IT Officer (Scale-II)’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
students-icon
354k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow