Question: Given class E,D,C & F below, what gets printed after executing the following line of code: Fb = new F(); class E{ public int a

Given class E,D,C & F below, what gets printed after executing the following line of code: Fb = new F(); class E{ public int a = 9; private int age = 18; public int geta return age; } public void update(int f) { a = f; } public void u Age(int i) { age = 1; } public String toString() { return "E"; } class D extends E{ public D() { superO; update(10); } public String toString() { Strings = "D"; int i = (a - getAO); return i+s; } class C extends D { public c() { superO; Age(13); } public String toString({ String s = "C"; int i = (a - getAC); return s + i; } public class F { public Foi Cc = new CO: System.out.print(c); D d = new DO: System.out.print(d.toString(); } O a. D-8-3C O b. C-3-8D O c. M1: 3.0 M3: 6.0 O d. 8D-3C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
