Question: Given class E,D,C & F below, what gets printed after executing the following line of code: D b = new D (); System.out.print(b); class E{

Given class E,D,C & F below, what gets printed after executing the following line of code: D b = new D (); System.out.print(b); class E{ public int a = 9; private int age = 18; public int getA() { return age; } public void update(int f) { a = f; } public void uAge(int i) { class D extends E{ public D( ) { super(); update(10); } public String toString() { String s = "D"; int i = (a - getA()); return i+s; } } age = i; } public String toString() { return "E"; } class C extends D { public c ( { super(); uAge(13); public class F{ public FO) { C C = new CO; System.out.print(c); D d = new DO; System.out.print(d.toString()); "C"; public String toString() { String s = int i = (a - getA()); return s + i; } } . 999999D O b. 9D O C. -8D O d. -9D
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
