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


Please Help Members By Posting Answers For Below Questions

What is abstraction encapsulation?

663


2. Give the different notations for the class.\

1594


What is the difference between a constructor and a destructor?

617


What is encapsulation with example?

583


Templates mean

1592






What is polymorphism give a real life example?

565


What are oops functions?

587


officer say me - i am offered to a smoking , then what can you say

1586


What is the difference between procedural programming and oops?

559


What is encapsulation in simple terms?

542


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

2010


Explain virtual inheritance?

686


What is polymorphism explain its types?

688


What is overriding in oops?

606


State what is encapsulation and friend function?

703