InterviewSolution
Saved Bookmarks
| 1. |
Can local class members access/use the general local variables (except static, abstract etc.) of the function in which it is defined?(a) Yes, it can access with arrow operator(b) No, it can’t access with dot operator(c) Yes, it can access using dot operator(d) No, it can’t access In anywayThe question was asked in semester exam.The above asked question is from Local Class topic in portion Class Members & Types of Object Oriented Programming |
|
Answer» CORRECT option is (d) No, it can’t ACCESS In anyway Best explanation: The LOCAL variables of the functions are not available to the member functions of the class. This is done to reduce the ambiguity in variables and their access rules. |
|