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

ambiguity regulation of multiple inheritance with example.

1 Answers  


What is the difference between declaration and definition?

20 Answers   IBS,


What is the example of polymorphism?

0 Answers  


What is Method overloading?

5 Answers  


What is use of overloading?

0 Answers  






What is DeadlyDiamondDeathProblem ?

1 Answers  


when to use 'mutable' keyword and when to use 'const cast' in c++

0 Answers   TCS,


What is an object?

14 Answers   HCL,


Why is it so that we can have virtual constructors but we cannot have virtual destructors?

2 Answers  


Write on signed and unsigned integers and give three (3) examples each

1 Answers  


what is the difference between class to class type conversion and copy constructor ?

2 Answers  


State what is encapsulation and friend function?

0 Answers   BirlaSoft,


Categories