lab7
This commit is contained in:
27
test/Cat.java
Normal file
27
test/Cat.java
Normal file
@ -0,0 +1,27 @@
|
||||
public class Cat {
|
||||
protected String name;
|
||||
protected String color;
|
||||
|
||||
|
||||
public Cat (String name, String color) {
|
||||
this.name = name;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String catName) {
|
||||
name = catName;
|
||||
}
|
||||
|
||||
public String catSays() {
|
||||
return "Meow";
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user