1.

Which access specifier should be used so that all the parent class members can be inherited and accessed from outside the class?(a) Private(b) Default or public(c) Protected or private(d) PublicThis question was addressed to me in a job interview.My query is from Access Specifiers topic in chapter Access Specifiers of Object Oriented Programming

Answer»

Correct answer is (d) Public

Easiest EXPLANATION - All the MEMBERS MUST be of public access. So that the members can be inherited EASILY. Also, the members will be AVAILABLE from outside the class.



Discussion

No Comment Found

Related InterviewSolutions