1.

Which among the following is an advantage of using classes over structures of C?(a) Functions are restricted(b) Functions can’t be defined(c) Functions can also be encapsulated(d) Functions can have more securityThe question was posed to me in an interview for internship.My question is taken from Class Use in chapter Classes of Object Oriented Programming

Answer»

The correct option is (c) Functions can also be encapsulated

The BEST explanation: The functions are also made easy to be encapsulated INSIDE a class. In structures, only the data members were allowed to be encapsulated. HENCE classes can represent an entity in a better WAY.



Discussion

No Comment Found

Related InterviewSolutions