Click here to Skip to main content
13,048,846 members (68,880 online)
Rate this:
Please Sign up or sign in to vote.
See more:
A Derived Class is often larger than and more general than its base class.

This True of False
I Solved It False Am I right or not ?!!
Posted 4-Jan-13 7:20am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

False as base class is parent and more general.

You were right, but next time, do add the reason on why you think so.
Turbo_23 4-Jan-13 14:04pm
Well, the question is incorrect, so, strictly speaking, any answer makes no sense. In certain way, "false" is better then "true", but this is not really a "good" answer.
I explain it in my answer, please see.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

This is a totally incorrect question. It has two different and unrelated statement in it. The derived class it usually larger, that's true (only usually, not always, and only in certain sense, please see below), but normally not more general, but just the opposite, more specialized. It cannot be answered by one true or false.

So, correct answer is: the question makes no sense, by the reason explained above.

To be more precise: a relationship "larger" is not defined for classes. When I said "larger" above, I rather meant: if you create instance of the base class and instance of the derived class, it's pretty usual that the first one takes less memory; however, it's easy to design the sample where things are the opposite. This statement is based on simple fact that the derived class has all members of the base class and possibly something else. But! with less number of members you can get more memory than with more members. For example, you can initialize a long string in base class, make it much shorted in derived class but add more members. Then base class is larger. You can invent some other meanings of the relationship "larger", based in common English. It does not mean it has strict sense. Asking such questions is just dishonest.

I suspect this is the interview question. I also suspect it is invented by people who very purely understand the essence things. Again! If you go for interviews, you face too many morons, unfortunately.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 4 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100