Question: ttps: / / online . iona.edu / ultra / courses / _ 4 8 3 7 8 _ 1 / cl / outline ~~ Question

ttps://online.iona.edu/ultra/courses/_48378_1/cl/outline
~~ Question Completion Statusi
Assume that the following classes have been defined:
public class Dinosaur extends Animal f public class Animal t
public void talk () f public string tostring () f
system,out.pxint ("Rawx!") ;
talk();
xeturn "Anima1";
i
i.
public vold talk ()(
system.out.print ("Gobble") :
public class Mamal extends Animal
public String tostring () f
return "Mamma i";
i.
,
public void eat ()}.
System,out.print ("Munch") ;
super, talk () :
public void eat ()(i)
System,put.print ("Nam narn"):
}
public class Raptor extends Dinosaur {
}
public void eat () i
j
System,out.print ("Yum"):
talk();
)
Given the classes above:
What output is produced by the following code?
Animal [] elements
new Dinosaur (), new Mammal (), new Raptor (), new Animal ()
};
for (int i=0;i elements. length; i+t i
System.out.println(elements [i]) ;
elements [i].eat ();
system.out.printin ();
elements [i].talk ();
system.out.println ();
system.out.printin ();
}
For the toolbar, press ALT+F10(PC) or ALT+FN+F10(Mac).
B
4? s
Paragraph
Arial
10pt
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
Search
 ttps://online.iona.edu/ultra/courses/_48378_1/cl/outline ~~ Question Completion Statusi Assume that the following classes have

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!