1.

Which type of data can a local class access from the function in which it is defined?(a) Static and extern(b) Abstract and static(c) Void and extern(d) Const and staticI had been asked this question by my college professor while I was bunking the class.I need to ask this question from Local Class in division Class Members & Types of Object Oriented Programming

Answer»

Correct ANSWER is (a) Static and extern

Easy explanation - The local classes have this feature to ACCESS the static and extern variables of the function in which those are DEFINED. This feature is available since these type of data are common to the program and is CREATED only one time. Run time CREATION and destruction of these variables is not done. The only restriction that may apply is those members must be constants.



Discussion

No Comment Found

Related InterviewSolutions