In multiple inheritance , to create sub class object , is
there need to create objects for its superclasses???
in java and c++ both. Actually i have some information that
is , all available members from its superclasses , memory
created in subclass obj , so no need to create object for
its superclasses...???

Thanks in Advance



In multiple inheritance , to create sub class object , is there need to create objects for its sup..

Answer / abhishek

Hi,

There is no need to create an object of the base class, if you want to create an object of the derived class. It is automatically created internally. When you create an object of the derived class then, the constructor of the base class is called first and then the constructor of the derived class. Hence, depending upon the scope specified by access specifiers, we can directly the use the members of the Base class using the object of the Derived class.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More OOPS Interview Questions

define a string class. overload the operator == to compare two strings

2 Answers   Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,


What is function overloading and operator overloading?

4 Answers  


what is virtual function?

26 Answers   Aspire, HP, Infosys, RoboSoft, TCS,


what is the size of an empty class

12 Answers   Wipro,


How is exception handling carried out in c++?

3 Answers  






What is namespace?

15 Answers  


What is an interface in oop?

0 Answers  


What is destructor example?

0 Answers  


How do you explain polymorphism?

0 Answers  


what is virtual destructor

7 Answers   L&T, TCS,


explain sub-type and sub class? atleast u have differ it into 4 points?

0 Answers   Infosys,


In multilevel inheritance constructors will be executed from the .... class to ... class

2 Answers   ABCO, TCS,


Categories