public class Shark extends Fish { private int energy; public Shark(int pos, int startingEnergy) { super(pos); // call Fish constructor this.energy = startingEnergy; } public void eat() { System.out.println("The shark eats!"); energy += 10; } public int getEnergy() { return energy; } // this implementation replaces the swim implementation from Fish @Override public void swim() { System.out.println("The shark stalks its prey!"); } // replaces the toString implementation from Object @Override public String toString() { return "[this is a shark]"; } }