This week's book giveaway is in the Testing forum. We're giving away four copies of The Way of the Web Tester: A Beginner's Guide to Automating Tests and have Jonathan Rasmusson on-line! See this thread for details.
Sub class reference can be assigned to super class reference. But super class reference cannot be assigned to sub class reference(without explicit casting).Why it is so? Can anyone explain me in detail? Thanks, Senthil
Marilyn de Queiroz
posted 15 years ago
The Subclass object ALWAYS is a Superclass object by definition. However, the reverse is not true. For example, Dog "is a" Animal, but Animal is NOT always a Dog.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt