I'm studying for the
SCJP exam, and I'm writing some sample code to further examine the self-test questions from the SCJP 6 Study Guide. I am confused as to why there is no ClassCastException when we say:
Why am I allowed to downcast a Tree to a Redwood? I'm guessing it has something to do with the fact that the object is not referenced by a reference variable, but that's a shot in the dark. I am satisfied with the reason it happens when we say:
Any information would be appreciated: