1.

The keyword static is used _______________(a) With declaration inside class and with definition outside the class(b) With declaration inside class and not with definition outside the class(c) With declaration and definition wherever done(d) With each call to the member functionI have been asked this question in a national level competition.The query is from Static Member Functions topic in section Exception Handling & Static Class Members of Object Oriented Programming

Answer» CORRECT choice is (b) With declaration inside class and not with definition outside the class

The best I can explain: The KEYWORD is USED only inside the class while declaring the static member. Outside the class, only definition with proper syntax is given. There is no need of SPECIFYING the keyword static again.


Discussion

No Comment Found

Related InterviewSolutions