Hi,
Ok I understand what they mean, superClass is a class which a subClass is made up of.
A subClass will have all the state attributes & method protocol of its superClass and then extra stuff relative to its own class.
Why is super and sub used in this way...
e.g.
If you went into MacDonalds and asked to super size your Bic Mac meal, you wouldn't get a kids happy meal.
If you had a sub set of something, the sub set wouldn't necessarily contain all of the elements of the set, it's only a subset if all the elements of the subset were in the main set.
As all the elements in a subClass are not in the superClass, it's the other way round, a subClass is not a subset.
So what is the reason for this sub/super terminology.
The only thing I can think of is 'Superceed' , so the superClass goes 'before' the subClass.
Is this a correct analogy?
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
Ok I understand what they mean, superClass is a class which a subClass is made up of.
A subClass will have all the state attributes & method protocol of its superClass and then extra stuff relative to its own class.
Why is super and sub used in this way...
e.g.
If you went into MacDonalds and asked to super size your Bic Mac meal, you wouldn't get a kids happy meal.
If you had a sub set of something, the sub set wouldn't necessarily contain all of the elements of the set, it's only a subset if all the elements of the subset were in the main set.
As all the elements in a subClass are not in the superClass, it's the other way round, a subClass is not a subset.
So what is the reason for this sub/super terminology.
The only thing I can think of is 'Superceed' , so the superClass goes 'before' the subClass.
Is this a correct analogy?
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!