There is a Flower class which extends class Plant. This Flower…

Question Answered step-by-step There is a Flower class which extends class Plant. This Flower… There is a Flower class which extends class Plant. This Flower class should:- Have an instance data member colorOfFlower of String, which records the main color of this flower;- A default constructor(0 parameters);- A constructor with three parameters to initialize all data members;- Override the toString method to return a string including plant, name, cost, and color of flower. You must take advantage of the toString() of the parent class. All instance data members should be private and all constructors and methods should be public unless specified otherwise. Comments may be omitted.Here is the class diagram of the class Plant(do not build this class but build the child class Flower): Image transcription textPlant name : String – cost : double + Plant() + Plant(name : String, cost : double) +getName() : String +getCost(): double +toString () : String… Show moreAssume the toString() of Plant will return a string like this:     Product Name: name of this obj: Cost: $xxx.xx Computer Science Engineering & Technology Object-Oriented Programming CS 252 Share QuestionEmailCopy link Comments (0)