Question: public class D I public void method ) ( } Syster. out.printlin ( d d c ) ; } public class B extends of public

public class D I
public void method )(
}
Syster. out.printlin(ddc);
}
public class B extends of
public void methodiO
Syster.out.println ('b1') :
}
super. nethod1O;
public void method20{
Syster out.println((62'') :
rethod10;
}
}
public class C extends 0{
public void method10
}
Syster out.printlin("c1");
public yoid rethodzo
Systert, out, printin((Cl'')
f
super, nethod1()
f
public class A extends B {
public void rethod10{
Syster, out, println("a1"):
super retehod1O;
public void methodz()(
Syster, out.printin("{:az');
super, nethod2O; ;
Suppose the following variables are defined:
A var 1= new A();
D var 2= new B();
C var 3= new C();
B var 4= new A();
Object var5= new D();
Indicate in each box below the output produced by the numbered statements shown below.
If the statement produces more than one line of output indicate the line breaks with slashes
as in to indicate three lines of output with a followed by followed by
If the statement causes a
or a
indicate this by simply writing
error. You do not need to identify which type.
Statement 1: var1.method2();
Statement 2: var2,method2();
Statement 3: var3.method1();
Statement 4: ((D)var4). method1();
Statement 5: var5.method1();
 public class D I public void method )( } Syster. out.printlin(ddc);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!