1.

The static data member ______________________(a) Must be defined inside the class(b) Must be defined outside the class(c) Must be defined in main function(d) Must be defined using constructorThis question was addressed to me during an online exam.This question is from Static Data Members topic in section Exception Handling & Static Class Members of Object Oriented Programming

Answer»

Right option is (b) MUST be defined outside the CLASS

Explanation: The static data members must be defined outside the class. Since these are common to all the objects and should be created only once, they must not be defined in the CONSTRUCTOR.



Discussion

No Comment Found

Related InterviewSolutions