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 multilevel inheritance explain with example?
How do you define a class in oop?
What is encapsulation example?
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.
What is debug class?what is trace class? What differences are between them? With examples.
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.
What is constructor overloading in oop?
what are the different types of qualifier in java?
What is multilevel inheritance in oop?
What does and I oop mean?
What is abstraction in oop?
Why do we use class?
Which is not an object oriented programming language?
Why is oop better than procedural?