Duck.java 296B

12345678910111213141516171819
  1. /**
  2. * Write a description of class Duck here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Duck extends Pet
  8. {
  9. public Duck(String name){
  10. super(name);
  11. super.setType("Duck");
  12. }
  13. public String speak(){
  14. return "quack";
  15. }
  16. }