8. Determine the output of the following Java program consisting of the files: I
ID: 3732544 • Letter: 8
Question
8. Determine the output of the following Java program consisting of the files: Itype.java, Atype.java, Btype.java and ItypeTest.java. Assume that all files are in the same directory // Itype.java interface Itype void foo) // Atype.java class Atype implements Itype( public void fooSystem.out.println ("in Atype's foo )"h public String toString)f return "I am an Atype object" ) 77 Btype.java class Btype extends Atype Btype ()System.out.println ("constructing a Btype object"); 1 public void fooSystem.out.println ("in Btype's foo )" public void bar System.out.println ("in Bytpe's bar )") ) public String toString) return "I am a Btype object" ) // ItypeTest.java class ItypeTest public static void main (String[] args) Itype I; Atype A; Btype B; A new Atype ); Bnew Btype ); AB B.bar ) System.out.println (I); System.out.println (A) System.out.println (B);Explanation / Answer
constructing a Btype object
in Atype's foo()
in Btype's foo()
in Btype's bar()
I am an Atype object
I am a Btype object
I am a Btype object
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.