1.

Which keyword should be used to declare static variables?(a) static(b) stat(c) common(d) constThis question was posed to me in an interview for internship.I'm obligated to ask this question of Static Data Members in chapter Exception Handling & Static Class Members of Object Oriented Programming

Answer» CORRECT option is (a) static

To explain I would say: The KEYWORD USED to declare static variables is static. This is MUST be used while declaring the static variables. The COMPILER can make variables static if and only if they are mentioned with static keyword.


Discussion

No Comment Found

Related InterviewSolutions