1.

Local classes can access the type names and enumerators defined by the enclosing function.(a) True(b) FalseThe question was asked in an interview for job.My question is from Local Class topic in portion Class Members & Types of Object Oriented Programming

Answer»

The correct ANSWER is (a) True

Easiest explanation - This is a little TRICKY part with local classes. THOUGH the local class can’t access the general variables of the function but can access the types that are DEFINED INSIDE the function. This is because the whole definition of that type would be existing inside the class.



Discussion

No Comment Found

Related InterviewSolutions