[Solved] Size difference between base class and derived class
Because you declared: Box simpleBox = new Box(); In this case, the “simpleBox” variable is declared of type “Box” this means that you can re-assign any object instance to it that is assignment compatible with Box. At declaration time, you’ve given it a value which happens to be of that same class. Since wt is … Read more