Question: The following question refers to the following three classes: Animal.java ScoobyDoo.java Shaggy.java WhereAreYou.java public class Animal { public String getColor ( ) { return yellow;

The following question refers to the following three classes:
Animal.java ScoobyDoo.java Shaggy.java WhereAreYou.java
public class Animal
{
public String getColor()
{
return "yellow";
}
public String getSize()
{
return "microscopic";
}
}
public class ScoobyDoo extends Animal
{
public String getColor()
{
return "purple";
}
public String getSize()
{
return "50 lbs";
}
}
public class Shaggy extends Animal
{
public String getColor()
{
return "grey";
}
public String getSize()
{
return "125 lbs";
}
}
public class WhereAreYou
{
public static void main(String[] args)
{
ScoobyDoo a=new ScoobyDoo();
Shaggy b=new Shaggy();
Animal c=new Animal();
Animal d=c;
System.out.println(a.getColor());
System.out.println(b.getColor());
System.out.println(c.getColor());
System.out.println(d.getColor());
}
}
When running WhereAreYou, the output is four lines. In each of the four lines blanks below, provide the output.

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!