1.

Which amongst the following is true for hybrid inheritance?(a) Constructor calls are in reverse(b) Constructor calls are priority based(c) Constructor of only derived class is called(d) Constructor calls are usualThe question was posed to me in an interview for job.Asked question is from Hybrid Inheritance topic in division Inheritance & its Types of Object Oriented Programming

Answer»

Right answer is (d) Constructor calls are usual

Easiest explanation - The CONSTRUCTORS will be called in usual way. First the PARENT class Constructor and then the derived class Constructors. This is DONE to INITIALISE all the members PROPERLY.



Discussion

No Comment Found

Related InterviewSolutions