1234567891011121314151617181920212223242526272829303132
  1. /**
  2. * Write a description of class Pet here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class Pet
  8. {
  9. // instance variables - replace the example below with your own
  10. private String name;
  11. private String speak;
  12. public void Pet(){
  13. this.name = name;
  14. this.speak = "chirp";
  15. }
  16. public void setName(String name){
  17. this.name = name;
  18. }
  19. public String getName(){
  20. return name;
  21. }
  22. public String speak(){
  23. return speak;
  24. }
  25. }