When a private constructer is being inherited from one
class to another class and when the object is instantiated
is the space reserved for this private variable in the
memory??
Answer Posted / sanjay makwana, puna
Private Constructor is not inherited.
When private member varible is not inherited but the size is
occupid in dervied class object.
e.g.
#include <iostream.h>
class A
{
int x;
int y;
};
class B : private A
{
};
int main()
{
cout << sizeof(B);
}
output :
8
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is abstraction encapsulation?
2. Give the different notations for the class.\
What is the difference between a constructor and a destructor?
What is encapsulation with example?
Templates mean
What is polymorphism give a real life example?
What are oops functions?
officer say me - i am offered to a smoking , then what can you say
What is the difference between procedural programming and oops?
What is encapsulation in simple terms?
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
Explain virtual inheritance?
What is polymorphism explain its types?
What is overriding in oops?
State what is encapsulation and friend function?