Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(24 pts) This code is all in one file. In the blanks provided, write what each l

ID: 3873742 • Letter: #

Question

(24 pts) This code is all in one file. In the blanks provided, write what each line would print, or "error" if that line would cause an error. class Cow [ String say"B"; String speak) [ return say; void chat (Cow cl) [ System. out.println("A " + this.speak () "G "c1. speak () ); class CalI extends Cow t Calf(){ say = "F"; void chat (Cow cl) ( System. out.println( "G " + this.speak () "C "c1. speak () ); class Main [ public statiC VOid main (Stringa Cow c1 new Cow ( ) ; Calf c3 = new Calf(); c1.chat (c3); c3.chat (c1); c1.chat (c2); c2.chat (c3); c3.chat (c2);

Explanation / Answer

Answer:

c1.chat(c3); will print A B G F

c3.chat(c1); will print G F C B

c1.chat(c2); will print A B G F

c2.chat(c3);will print G F C F

c3.chat(c2); will print G F C F