123456789101112131415161718
  1. public class Cow extends Pet
  2. {
  3. private String speak;
  4. public Cow()
  5. {
  6. this.speak = "Moo";
  7. }
  8. @Override
  9. public String speak()
  10. {
  11. return speak;
  12. }
  13. }