hi all,
I was taking the self test in SCJP study guide where this code confused me.
This code throws ClassCastException when Tree is downcast to Redwood.
But I dont understand why. To try this out I used an existing code and tried upcasting and downcasting.
I dont understand how come this one is working fine.
Regards
Sudhanshu Gupta
I was taking the self test in SCJP study guide where this code confused me.
This code throws ClassCastException when Tree is downcast to Redwood.
But I dont understand why. To try this out I used an existing code and tried upcasting and downcasting.
I dont understand how come this one is working fine.
Regards
Sudhanshu Gupta