Fish.java 545B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * Write a description of class Fish here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Fish extends Pet
  8. {
  9. // instance variables - replace the example below with your own
  10. String type = "fish";
  11. /**
  12. * Constructor for objects of class Fish
  13. */
  14. public Fish(String name)
  15. {
  16. super.Pet(name);
  17. }
  18. public Fish ()
  19. {
  20. }
  21. public String speak(){
  22. return "Fish say GLUB GLUB";
  23. }
  24. public String getType(){
  25. return this.type;
  26. }
  27. }