1.

The static member functions can only use ________(a) Static data members(b) Private data members(c) Protected data members(d) Constant data membersI had been asked this question in a job interview.The query is from Data Members in portion Class Members & Types of Object Oriented Programming

Answer»

The correct answer is (a) STATIC data MEMBERS

To explain: The static member functions can only access static data members. This is because the static member function can’t WORK with the properties that change object to object. It is mandatory that only the common properties of all the objects be used. And only static data members are common to all as those are PROPERTY of class.



Discussion

No Comment Found

Related InterviewSolutions