, "superRectangle" "myRectangle", . , .
, MyRectangle YourRectangle SuperRectangle...
:
SuperRectangle superRect = new MyRectangle();
MyRectangle castedMyRect = (MyRectangle)superRect;
ClassCastException:
SuperRectangle superRect = new MyRectangle();
YourRectangle castedYourRect = (YourRectangle)superRect;