For the given parent class, write a child class that satisfies the following requirements: • child class is named your first name • overrides the squish method in the child class • overloads the grow...


Please answer question. This is pertaining to Java programming language


2-23


For the given parent class, write a child class that satisfies the following requirements:<br>• child class is named your first name<br>• overrides the squish method in the child class<br>• overloads the grow method in the child class<br>• method signature can be of your choosing, if applicable, and you do not need to<br>provide the method body for those two methods (i.e. only need { })<br>• double instance variable named ripeness, and follows encapsulation<br>• overrides the equals method from the Object class<br>o must use all instance fields to determine equality<br>• you do not need to write any constructors, getters, or setters<br>public class Berry {<br>// override<br>public void squish(int[] arr, char letter) {<br>//method body<br>}<br>// overload<br>public int grow(String type, int time) {<br>//method body<br>}<br>}<br>Make sure to select the 'Preformatted' style from the dropdown so your code is<br>formatted clearly.<br>

Extracted text: For the given parent class, write a child class that satisfies the following requirements: • child class is named your first name • overrides the squish method in the child class • overloads the grow method in the child class • method signature can be of your choosing, if applicable, and you do not need to provide the method body for those two methods (i.e. only need { }) • double instance variable named ripeness, and follows encapsulation • overrides the equals method from the Object class o must use all instance fields to determine equality • you do not need to write any constructors, getters, or setters public class Berry { // override public void squish(int[] arr, char letter) { //method body } // overload public int grow(String type, int time) { //method body } } Make sure to select the 'Preformatted' style from the dropdown so your code is formatted clearly.
DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY<br>SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD.<br>Your Answer:<br>/**<br>*Extends Class.<br>* /<br>public class Alexander Extends Berry {<br>/*<br>* @Override<br>*/<br>public void vegetable(int[] arr, char letter) {<br>squish squish1 = new squish(int[] arr1, char letter2);<br>}<br>/**<br>* @Overload<br>* /<br>public int grower (String type, int time) {<br>this.type<br>this.time = time;<br>type;<br>}<br>/**<br>* Instance.<br>* /<br>private double ripeness(char letter) {<br>//Gross.<br>squash1. EqualsTo(Rotten);<br>}<br>}<br>

Extracted text: DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD. Your Answer: /** *Extends Class. * / public class Alexander Extends Berry { /* * @Override */ public void vegetable(int[] arr, char letter) { squish squish1 = new squish(int[] arr1, char letter2); } /** * @Overload * / public int grower (String type, int time) { this.type this.time = time; type; } /** * Instance. * / private double ripeness(char letter) { //Gross. squash1. EqualsTo(Rotten); } }

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here