Plant Flower extends Plant name: String color: String has Smell: boolean has Thorn: boolean * / /* accessor-mutator */ /* tostring */ /* constructor */ /* accessor-mutator */ /* tostring */ /*...


this is a java program Complete the task and using for each loop , give me the code here and a screenshot of the output


Plant<br>Flower extends Plant<br>name: String<br>color: String<br>has Smell: boolean<br>has Thorn: boolean<br>* /<br>/* accessor-mutator */<br>/* tostring */<br>/* constructor */<br>/* accessor-mutator */<br>/* tostring */<br>/* constructor<br>Herb extends Plant<br>isMedicinal: boolean<br>season: String<br>constructor */<br>/* accessor-mutator */<br>/* tostring */<br>In main method, create an array of Plant objects and implement these<br>methods: static void add(Plant [] plants, Plant p) // to add new plant object into<br>the array static void remove(Plant [] plants, String n) // remove a plant given<br>its name static Plant search(Plant [] plants, String n) // search for a plant given<br>its name static void display(Plant [] plants) // display all Plant objects<br>

Extracted text: Plant Flower extends Plant name: String color: String has Smell: boolean has Thorn: boolean * / /* accessor-mutator */ /* tostring */ /* constructor */ /* accessor-mutator */ /* tostring */ /* constructor Herb extends Plant isMedicinal: boolean season: String constructor */ /* accessor-mutator */ /* tostring */ In main method, create an array of Plant objects and implement these methods: static void add(Plant [] plants, Plant p) // to add new plant object into the array static void remove(Plant [] plants, String n) // remove a plant given its name static Plant search(Plant [] plants, String n) // search for a plant given its name static void display(Plant [] plants) // display all Plant objects

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here