BabyDucks.java 621B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Write a description of class BabyDucks here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class BabyDucks extends Pet
  8. {
  9. // instance variables - replace the example below with your own
  10. private int x;
  11. public BabyDucks()
  12. {
  13. // initialise instance variables
  14. x = 0;
  15. }
  16. /**
  17. * An example of a method - replace this comment with your own
  18. *
  19. * @param y a sample parameter for a method
  20. * @return the sum of x and y
  21. */
  22. @Override
  23. public String speak(){
  24. return "All your base are belong to us.";
  25. }
  26. }