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

what is difference between c++ language and java language

5 Answers  


What is an example of genetic polymorphism?

0 Answers  


What is oops in simple words?

0 Answers  


How do you define a class in oop?

0 Answers  


sir plz send me a set of questions that been frequently held in written examination during campus selection.

0 Answers   TCS,






what is virtual destructor

7 Answers   L&T, TCS,


How to overload new operator in c++

2 Answers  


How to hide the base class functionality in Inheritance?

0 Answers   Viscus Infotech,


what is the sylabus for priliminaries?

0 Answers  


A file pointer always contains the __________ of the file

5 Answers  


What is abstraction in oops with example?

0 Answers  


What is the difference between pass by reference and pass by value?

12 Answers   Pfizer, TCS,


Categories