class P { void a() { System.out.println(\"a\"); } void b() { System.out.println(\"b\"); } } class C extends P { void c() { S
P p = c;
Don't cast at all. A C is a P; no explicit conversion is required. With no cast, you make it clear that this operation cannot fail; with a cast, you force the reader to consider and discard the possibility that c is not an instance of P.
C
P
c