- Assume You Have The Following 3 Classes A B And C Their Details Are Left Out Only Is Shown However Assume 1 (62.45 KiB) Viewed 42 times
Assume you have the following 3 classes A, B, and C. Their details are left out (only { ... } is shown). However, assume
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Assume you have the following 3 classes A, B, and C. Their details are left out (only { ... } is shown). However, assume
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;