Question: 4.2. Consider the following code. class A { void m(Ax) { System.out.println(AA); } void m(Btimes ) { System.out.println(AB); } void m(Cx) { System.out.println(AC); } }
4.2. Consider the following code.\ class A {\ void
m(Ax){ System.out.println("AA"); }\ void
m(B\\\\times ){ System.out.println("AB"); }\ void
m(Cx){ System.out.println("AC"); }\ }\ class B extends A {\ void
m(Ax){ System.out.println("BA"); }\ void
m(Bx){ System.out.println("BB"); }\ void
m(Cx){ System.out.println("BC"); }\ }\ class
Cextends \ void
m(Ax){ System.out.println("CA"); }\ void
m(Bx){ System.out.println("CB"); }\ void
m_(C_(x)){ System.out.println ("CC"); }\ }\
Aa1
=new
A();\
Aa2
=new
B();\
Aa3
=new
C_(); _()\
Bb1 = new
B();\
Bb2 = new
C();\ C
c1=new \ Fill in each box with the output of the corresponding method invocation.\ For example:\ fill in the
4^(th )row and
2^(nd )column with the output of b1.m(a2).\ fill in the
2^(nd )row and
4^(th )column with the output of a2.m(b1)\ Hint: this problem goes fast once you see the pattern.

4.2. Consider the following code. class A \{ void m(Ax) \{system.out.println("AA"); \} void m(Bx) \{ System.out.println("AB"); \} void m(Cx) \{ System.out.println("AC"); \} \} class B extends A \{ void m(Ax) \{ System.out.println("BA"); \} void m(Bx) \{ System.out.println("BB"); \} void m(Cx) \{ System.out.println("BC"); \} \} class C extends B \{ void m(Ax) \{ System.out.println("CA"); \} void m(BB) \{ System.out.println("CB"); \} void m(Cx) \{ System.out.println("CC"); \} \} A a1 = new A(); A a 2 new B(); A a3 = new C(); Bb1= new B(); B b2 = new C(); cc1= new C(); 4.2. Consider the following code. class A \{ void m(Ax) \{system.out.println("AA"); \} void m(Bx) \{ System.out.println("AB"); \} void m(Cx) \{ System.out.println("AC"); \} \} class B extends A \{ void m(Ax) \{ System.out.println("BA"); \} void m(Bx) \{ System.out.println("BB"); \} void m(Cx) \{ System.out.println("BC"); \} \} class C extends B \{ void m(Ax) \{ System.out.println("CA"); \} void m(BB) \{ System.out.println("CB"); \} void m(Cx) \{ System.out.println("CC"); \} \} A a1 = new A(); A a 2 new B(); A a3 = new C(); Bb1= new B(); B b2 = new C(); cc1= new C()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
