extending superclass and ClassCastException
问题 I have a superclass, which two methods i want to override. Here's my code: public class MyCustomClass extends SomeSuperClass { protected MyCustomClass(params) { super(params); } @Override public void method1() { super.method1(); /* here goes my code */ } @Override public void method2() { super.method2(); /* here goes my another code */ } I have some constructor, that passes SomeSuperClass object as a parameter, and what i do next: MyCustomClass object; /* now i have object of type