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