- Feb 8, 2004
- 12,604
- 15
- 81
Im still at the very beginning here, learning terminology, simple code etc so i hope ive got it right.
1. Superclass declared variables can be assigned to Subclass objects but with a loss of the Subclasses functionality when referenced through the Superclass variable
but
2. Subclass declared variables cannot be assigned to Superclass objects at all
Why not? Surely it would be a similar situation either way except in number 2 the object would be the part that does not understand any Subclass specific commands.
I don't see why anyone would mix/match anyway but its for the purpose of learning
1. Superclass declared variables can be assigned to Subclass objects but with a loss of the Subclasses functionality when referenced through the Superclass variable
but
2. Subclass declared variables cannot be assigned to Superclass objects at all
Why not? Surely it would be a similar situation either way except in number 2 the object would be the part that does not understand any Subclass specific commands.
I don't see why anyone would mix/match anyway but its for the purpose of learning
