Pet.java 296B

1234567891011121314151617181920
  1. public class Pet
  2. {
  3. //instance fields
  4. private String name;
  5. private String speak;
  6. //methods
  7. public String speak(){
  8. return "unknown";
  9. }
  10. public void setName(String name){
  11. this.name = name;
  12. }
  13. public String getName(){
  14. return name;
  15. }
  16. }