Question: Consider the following class declarations. public class Plant {public String name; public Plant(String name) {this.name = name;}} public class Vegetable extends Plant {public String colour;

 Consider the following class declarations. public class Plant {public String name;

Consider the following class declarations. public class Plant {public String name; public Plant(String name) {this.name = name;}} public class Vegetable extends Plant {public String colour; public double weightInKg; public Vegetable(String name, String colour, double weightInKg) {//////}} Write the body of the Vegetable class constructor as indicated by the comment lines in the answer box below. For example

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!