Question: What does this code print? class Animal { protected String furColor = brown; Animal ( String color ) { this.furColor = grey; } } public

What does this code print?
class Animal
{
protected String furColor = "brown";
Animal(String color)
{
this.furColor = "grey";
}
}
public class Bear extends Animal
{
int weight;
Bear(int lbs, String color)
{
super("brown");
this.weight = lbs;
}
public static void main(String[] args)
{
Bear bear = new Bear(6, "panda");
System.out.print(bear.furColor);
}
}

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 Programming Questions!