ClassCastException vs. “cannot cast” compilation error
Why does the code above compile at all? Phone seems unrelated to Roamable to me? yes because Roamable is an interface it might cause a Run-time exception but not compile time exception, because even if Phone doesn’t implement Roamable, a subclass of Phone might, hence the compiler has no way to know it but at … Read more