1.

All member functions of a local class must be ___________(a) Defined outside class body(b) Defined outside the function definition(c) Defined inside the class body(d) Defined at starting of programI had been asked this question in an interview.My query is from Local Class in portion Class Members & Types of Object Oriented Programming

Answer»

The correct choice is (c) Defined INSIDE the CLASS body

The EXPLANATION: There is a restriction on where the MEMBER functions of the local class should be define. Those MUST be defined inside the class body only. This is to reduce the ambiguity and complexity of program.



Discussion

No Comment Found

Related InterviewSolutions