Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package t3;
- public class Cat {
- private String name;
- private String color;
- private int age;
- public Cat(String name,String color,int age) {
- this.name=name;
- this.color=color;
- this.age=age;
- }
- public String getName() {
- return this.name;
- }
- public void setName() {
- this.name=name;
- }
- public String getColor() {
- return this.color;
- }
- public void setColor() {
- this.color=color;
- }
- public int getAge() {
- return this.age;
- }
- public void setAge() {
- this.age=age;
- }
- public void sayMiau() {
- System.out.printf("%s said:Miauuu!\n",this.name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement