1.

Which among the following is correct definition for static member functions?(a) Functions created to allocate constant values to each object(b) Functions made to maintain single copy of member functions for all objects(c) Functions created to define the static members(d) Functions made to manipulate static programsI had been asked this question during an online interview.This is a very interesting question from Static Member Functions in chapter Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Correct choice is (B) FUNCTIONS made to maintain SINGLE copy of member functions for all objects

The explanation is: The functions which are made common, with respect to definition and data USAGE, to all the objects. These functions are ABLE to access the static data members of a class.



Discussion

No Comment Found

Related InterviewSolutions