Question: Consider the following Java code: interface I f int fo: int : abstract class C implements I ( publie int ro ( return 3:) class
Consider the following Java code: interface I f int fo: int : abstract class C implements I ( publie int ro ( return 3:) class D extends C( publie int fO ( return 7: public intO return ro+s super. fo: class E extends D ( public int fo return 11: class F extends E ( public int fO (return fO: in some other class, perhaps in mainO /. final Iy new EO: System, out. printin (y. gO): a) 1 What does this code print? (the two system. out. printlnO's) b) 1 What are the static (compile-time) and dynamic (runtime) types ofx? Static: Dynamic: c) 1 What are the static and dynamic types ofy? Static: Dynamic: d) 1 In the context of the code above, what happens when you evaluate the expression new FO. fO (this is legitimate "method chaining")? If there is any problem, what causes it
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
