1234567891011121314151617181920 |
-
- public class Pet
- {
- //instance fields
- private String name;
- private String speak;
-
- //methods
- public String speak(){
- return "unknown";
- }
-
- public void setName(String name){
- this.name = name;
- }
-
- public String getName(){
- return name;
- }
- }
|