An interviewer asked me this question and still i am not sure what's the proper answer of this...
Scenario :
We have Inheritance in which there is a "Base" Class and its "Child" class, Now if we instantiate Child class, its Parent/Base class is also is instantiate.
Now interviewer Asked me these questions...
interviewer : how .net framework manage Memory is this case, Does Heap contain One object or two ?
My Reply : One Object..
interviewer : if one then what space is the space it occupy ?
My Reply : Base + Child = Size of Memory.
interviewer : so if we instantiate a child class having 100 Parents in hierarchy, then Memory contain a object equal to 101 classes ...its pretty heavy..?
My Reply: Confused ! :(