About Question enthuware.ocpjp.v17.2.983 :
Posted: Tue Nov 05, 2024 11:14 am
Hi,
How come the explicit cast is not mandatory for but for it is?
b is declared of a type that indirectly implements Runnable, but isn't it declared of a type that directly implements Observer?
What do I miss?
Cheers,
Rafael
How come the explicit cast is not mandatory for
Code: Select all
Object o = b; Runnable r = (Runnable) b;
Code: Select all
Object o = b; Observer o2 = o;
b is declared of a type that indirectly implements Runnable, but isn't it declared of a type that directly implements Observer?
What do I miss?
Cheers,
Rafael