Are you talking about object inheritance?
If so, then it is simple: drop it.
, "Foo", - "Bar" ( : Bar "" Foo), :
Foo myFoo = getSomeFoo();
Bar myBar = (Bar)myFoo;
, :
View myView = getDecorView();
FrameLayout myFrameLayout = (FrameLayout) myView;
FrameLayout myFrameLayout = (FrameLayout) getDecorView();
, , , ClassCastException, , getDecorView, FrameLayout ( (in)). try/catch throwing , . .