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 different between oops and c++
What are benefits of oop?
hi all..i want to know oops concepts clearly can any1 explain??
Why is there no multiple inheritance?
What is polymorphism what is it for and how is it used?
What is overriding in oops?
What is difference between oop and pop?
Which method cannot be overridden?
What is the important feature of inheritance?
What is abstraction in oops with example?
What is oops and why we use oops?
What is purpose of inheritance?
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.
What are the benefits of oop?
What is oops concept with example?