Pet.java 679B

12345678910111213141516171819202122232425262728293031323334353637
  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. private String name;
  10. private String type;
  11. public Pet(String name){
  12. this.name = name;
  13. //this type = type;
  14. }
  15. public String speak() {
  16. return null; //
  17. }
  18. public void setType(String type){
  19. this.type = type;
  20. }
  21. public void setName(String name){
  22. this.name = name;
  23. }
  24. public String getName(){
  25. return name;
  26. } //getters have no parameter, setters do. getter just want to return value
  27. public String getType(){
  28. return type;
  29. }
  30. }