1.

Which among the following should be encapsulated?(a) The data which is prone to change is near future(b) The data prone to change in long terms(c) The data which is intended to be changed(d) The data which belongs to some other classThe question was asked during a job interview.Asked question is from Encapsulation topic in portion OOPs Concept & Features of Object Oriented Programming

Answer»

The correct answer is (a) The data which is prone to CHANGE is near FUTURE

To explain: The data prone to change in near future is usually encapsulated so that it doesn’t get changed ACCIDENTALLY. We ENCAPSULATE the data to hide the critical working of program from outside world.



Discussion

No Comment Found

Related InterviewSolutions