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 / 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 |
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.
Why u change company?
what is object slicing
Why do we need polymorphism in c#?
Program to print 0 to 9 in cross order
what is runtime polymorphism? For the 5 marks.
What is super in oop?
why the argument is passed by reference to a copy constructor?example?
What is the Advantage of Interface over the Inheritance in OOPS?
write a c++ program to find maximum of two numbers using inline functions.
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?