I tried to upcast an objet. But at runtime object class is remained as a derived class.
Derived drv = new Derived(); Base base = (Base) drv; System.out.print
You can not change the type of an instance in Java. All you're doing with your cast is reference it from a variable of a different type.