1.

If two classes combine some private data members and provides public member functions to access and manipulate those data members. Where is abstraction used?(a) Using private access specifier for data members(b) Using class concept with both data members and member functions(c) Using public member functions to access and manipulate the data members(d) Data is not sufficient to decide what is being usedThe question was posed to me during an internship interview.My question is based upon Abstraction in section OOPs Concept & Features of Object Oriented Programming

Answer»

Correct answer is (c) Using PUBLIC member functions to access and manipulate the data members

The explanation is: It is the concept of hiding program complexity and actual working in background. Hence USE of public member functions ILLUSTRATES ABSTRACTION here.



Discussion

No Comment Found

Related InterviewSolutions