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

Input: enter the value:1234 output: 1 2 3 4 write a program to get above output.....

4 Answers   Bally Technologies, IBM, SoftSol,


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

0 Answers  


Why u change company?

12 Answers   BOB Technologies,


what is object slicing

3 Answers   TCS,


Why do we need polymorphism in c#?

0 Answers  


Program to print 0 to 9 in cross order

3 Answers  


what is runtime polymorphism? For the 5 marks.

3 Answers  


What is super in oop?

0 Answers  


why the argument is passed by reference to a copy constructor?example?

2 Answers  


What is the Advantage of Interface over the Inheritance in OOPS?

4 Answers  


write a c++ program to find maximum of two numbers using inline functions.

3 Answers   IBM,


1.what are two type of classe members called? 2.what is data hiding and data encapsulation? 3.how do you make a class member visible aouside its class? 4.what is the default visibility of a class data member? 5.what are the advantages of oop over the structured programing?

6 Answers  


Categories