public class MammalMain { public static void main(String[] args) { Mammal[] mammals = new Mammal[4]; mammals[0] = new Dolphin(); mammals[1] = new Platypus(); mammals[2] = new Human(); mammals[3] = new CSStudent(); for (Mammal m : mammals) { System.out.print("Generally, a " + m.getName()); System.out.print( m.laysEggs() ? " lays eggs " : " gives live birth "); System.out.print(" and can be found "); System.out.print( m.livesInWater() ? "in water " : " on land"); System.out.print(" saying "); m.speak(); System.out.print("\n");; } } }