/* MonsterHarness.java example code AC Chapin */ package cis214.pkg11inheritance.Monsters; /** * class to test out Monster and its children **/ public class MonsterHarness { /** * main method demonstrating use of monsters * and inheritors **/ public static void main(String[] args) { System.out.println("---------------MONSTER"); Monster m = new Monster(); m.setTeeth(5); m.eat(); m.roar(); System.out.println(m); // can't fly, or sing, or set/get mySong System.out.println("---------------VAMPIREBAT"); VampireBat v = new VampireBat(); // number of teeth has been set by the constructor v.eat(); v.roar(); v.fly(); System.out.println(v); // can't sing or set/get mySong System.out.println("---------------MUPPETMONSTER"); MuppetMonster p = new MuppetMonster(); p.setTeeth(10); p.setMySong("I'm taking my oyster for walkies"); p.eat(); p.roar(); // does nothing p.sing(); System.out.println(p); // can't fly } }