Consider the following hierarchy of classes: Consider the following classes: pub
ID: 3839365 • Letter: C
Question
Consider the following hierarchy of classes: Consider the following classes: public class Blue extends Green public void one() f System out.println("Blue 1") super-one public class Red extends Yellow public void one super one System 1 public void two System 2 super two(); public class Yellow extends Blue public void two() System out.println ("Yellow 2") public void three f two() System out.println ("Yellow 3"); public class Green public void one System out.println ("Green 1 public void three System 3 And, suppose the following objects are declared in a client class: Statement 1: Green var1 new Blue() Statement 2: Green var2 new Red() Statement 3 Blue var new Yellow Statement 4: object var4 new Green ndicate in the boxes below the output produced by each of the statements. If the statement causes an error, write the word error to indicate this,Explanation / Answer
OUTPUT
A. var1.one();
Blue 1
Green 1
B. var1.two();
error
C. var1.three();
Green 3
D. var2.one();
Blue 1
Green 1
Red 1
E. var2.three();
Red 2
Yellow 2
Yellow 3
F. var3.one();
Blue 1
Green 1
G. var3.two();
error
H. var3.three()
Yellow 2
Yellow 3
I. var4.one();
error
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.