is it possible to run operators like ==, instance of, meaning after doing Object Type casting, can that (i.e. z in this case)reference of the class being casted ,able to use the class( since Z know nothing about X rather then just a CAST). like here , can reference of Z use all the methods of X once it's converted to X(). please explain if anybody would like.
Typecasting X to Z without X extending Z would give you a Compile time Error (inconvertible types). But in case X extends Z, then the instance z is allowed to use all methods of X. (like a normal extended class)
Class Z {} Class X extends Z{ Z z = (Z) new X(); }
Does this answer your question?
_ ______________________________ _ <br />I'm using jdk1.5.0_12