Question 67

Computer Awareness Object Oriented Programming Easy

Which of the following is not a member of class?

(A) static function
(B) Friend function
(C) const function
(D) Virtual function
View Dynamic Solution & Explanation
Correct Solution: Option B

Step-by-step Solution:

In object-oriented programming languages like C++, a class can have members like static functions, const functions, and virtual functions. However:\[\] 1. Static function: A static function is a member of a class that does not require an instance of the class to be accessed. \[\] 2. const function: A const function is a member function that does not alter the state of an object. It can exist within a class. \[\] 3. Virtual function: A virtual function allows polymorphism and can exist as part of a class definition. \[\] However, Friend function is not a member of the class itself. A friend function is defined outside the scope of a class, though it can access private and protected members of that class if declared as a friend.\[\] \[\] Correct Answer: (b)