Adding and Eating Worms. Mrs. C. Furman August 23, 2010. Let’s add a Worm Class. What class should we extend to add a Worm? Worm is-a Animal Select New Subclass from the Animal menu. Click here. Setting up the new Subclass. Enter the name as Worm
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Mrs. C. Furman
August 23, 2010
* Check whether we have found a worm
* If we have found a worm, we eat it.
* If we haven’t, we do nothing.
* PostCondition: After this method has
* been executed worms near the crab
* have been removed.
public void lookForWorm()
if (this.canSee(Worm.class) )