Question: Consider the following code: interface I1 { public void f(): } class A implements I1 { public void f() { //implementation } public static void

Consider the following code: interface I1 { public void f(): } class A implements I1 { public void f() { //implementation } public static void g(){ //implementation } } class B extends A { public void f() { //implementation } public static void g(){ //implementation } } Suppose I1 i1 = new B(): I1 i2 = new A(): A a1 = new A(): A a2 = new B(): A b1 = (A) new B(): Without writing any code, explain in words the effect of each of the following method calls. Just say things like "will call f method implemented in A" etc. b1.f(): b1.g(): i1.f(): a1.g(): i2.f(): a2.g()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
