1.

Can we call methods of base class using the constructor of the derived class?(a) Yes, always(b) Yes, but not always(c) No, never(d) No, but we can call in some casesI had been asked this question during an internship interview.My doubt stems from Base Class in chapter Classes of Object Oriented Programming

Answer»

The correct option is (a) Yes, always

Explanation: If the FUNCTION is defined in the base class, it can always be called from the CONSTRUCTOR of its derived class. Since the CONSTRUCTORS are not PRIVATE, they can be accessed in derived class even if those are PROTECTED.



Discussion

No Comment Found

Related InterviewSolutions