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 polymorphism in oops with example?
What is the difference between inheritance and polymorphism?
What are the benefits of interface?
Can you inherit a private class?
how to get the oracle certification? send me the answer
What is polymorphism and its types?
What does and I oop and sksksk mean?
What is this pointer in oop?
what is difference between class template and template class?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
Which method cannot be overridden?
c++ program to swap the objects of two different classes
Why do we use oops?
What is polymorphism what is it for and how is it used?
What are the 5 oop principles?