1.

What are static member functions?(a) Functions which use only static data member but can’t be accessed directly(b) Functions which uses static and other data members(c) Functions which can be accessed outside the class with the data members(d) Functions using only static data and can be accessed directly in main() functionThis question was posed to me in examination.This key question is from Types of Member Functions topic in portion Member Functions & its Types of Object Oriented Programming

Answer»

Right CHOICE is (d) Functions using only STATIC data and can be accessed directly in main() function

Explanation: The static MEMBER functions can be accessed directly in the main function. There is no restriction on direct use. We can call them with use of objects also. But the restriction is that the static member functions can only use the static data MEMBERS of the CLASS.



Discussion

No Comment Found

Related InterviewSolutions