Assume you have the following 3 classes A, B, and C. Their details are left out (only { ... } is shown). However, assume
Posted: Fri Jul 08, 2022 6:43 am
Assume you have the following 3 classes A, B, and C. Their details are left out (only { ... } is shown). However, assume that each class has a default constructor defined. public class A {...} public class B extends A {...} public class C extends B {...} What will happen if the following fragment of code is executed? If there will be an error, explain it fully. A a = new B(); A a1; B b; Cc: b = (B) a; a1 = b; c = (C) a1;