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
Answer Posted / 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 View All Answers
What is persistence in oop?
Why is abstraction used?
Why do we use class in oops?
What is super in oop?
What is the oops and benefits of oops programming?
What is class encapsulation?
i got a backdoor offer in process global,Bangalore..Can i work with it?
What does enum stand for?
What is inheritance in oop?
What is for loop and its syntax?
what are the realtime excercises in C++?
What is oops and its features?
What is ambiguity in inheritance?
What is the difference between procedural programming and oops?
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction