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
An upcast does not change the object's type. As a matter of fact, NOTHING changes a Java object's type.
That's the very core of OO programming: An object has a defined behavior that can't be influenced from the outside.