1.

How can Encapsulation be achieved?(a) Using Access Specifiers(b) Using only private members(c) Using inheritance(d) Using AbstractionI have been asked this question in an international level competition.This is a very interesting question from Encapsulation in section OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (a) USING Access Specifiers

The explanation: Using access specifiers we can ACHIEVE encapsulation. Using this we can in turn IMPLEMENT data abstraction. It’s not necessary that we only use PRIVATE access.



Discussion

No Comment Found

Related InterviewSolutions