/* VampireBat.java example code AC Chapin */ package cis214.pkg11inheritance.Monsters; /** * class representing a Vampire Bat **/ public class VampireBat extends Monster { /** * default constructor for VampireBat **/ public VampireBat() { super(); // call Monster constructor teeth = 2; // can only do if protected in Monster alive = false; } /** * vampirebats eat by sucking blood * overrides eat from Monster **/ public void eat() { System.out.println("I vant to suck your bluuud."); } /** * vampirebats can fly **/ public void fly() { System.out.println("Up above the world I fly, like a goth teatray in the sky."); } /** * overrides toString from Monster * while also using it * @return * string representing this VampireBat **/ public String toString() { return "vampire bat " + name; } }