Which code, inserted at line 16, will cause a java.lang.ClassCastException?
A. Alpha a = x;
B. Foo f = (Delta)x;
C. Foo f = (Alpha)x;
D. Beta b = (Beta)(Alpha)x;
Answer:B
Which code, inserted at line 16, will cause a java.lang.ClassCastException?
A. Alpha a = x; B. Foo f = (Delta)x; C. Foo f = (Alpha)x; D. Beta b = (Beta)(Alpha)x;