Saturday, December 7, 2013

which one is bigger: base or derived???

Let me ask you a question: between an object of a base class and an object of a child class that is derived from the base class, which one is bigger in terms of information?

Answer is : derived class object. The reason is derived class object contains base class object. It's like a child gets all his/her parents' genes,but at meanwhile he/she gets his/her own stuff.













No comments:

Post a Comment