Pet.java 389B

12345678910111213141516171819202122
  1. /**
  2. * Abstract class Pet - write a description of the class here
  3. *
  4. * @author (your name here)
  5. * @version (version number or date here)
  6. */
  7. public abstract class Pet {
  8. protected String name;
  9. public void setName(String name) {
  10. this.name = name;
  11. }
  12. public String getName() {
  13. return name;
  14. }
  15. public abstract String speak();
  16. }