Cat.java 349B

1234567891011121314151617181920212223
  1. /**
  2. * Write a description of class Cat here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Cat extends Pet{
  8. public String getName() {
  9. return name;
  10. }
  11. public void setName(String name) {
  12. this.name = name;
  13. }
  14. public String speak() {
  15. return "Meow";
  16. }
  17. }