Advertisement
Ivan_Bochev

Cat

Sep 20th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. package t3;
  2.  
  3. public class Cat {
  4. private String name;
  5. private String color;
  6. private int age;
  7.  
  8. public Cat(String name,String color,int age) {
  9.     this.name=name;
  10.     this.color=color;
  11.     this.age=age;
  12. }
  13.  
  14. public String getName() {
  15.     return this.name;
  16. }
  17.  
  18. public void setName() {
  19.     this.name=name;
  20. }
  21.  
  22. public String getColor() {
  23.     return this.color;
  24. }
  25.  
  26. public void setColor() {
  27.     this.color=color;
  28. }
  29.  
  30. public int getAge() {
  31.     return this.age;
  32. }
  33.  
  34. public void setAge() {
  35.     this.age=age;
  36. }
  37.  
  38. public void sayMiau() {
  39.     System.out.printf("%s said:Miauuu!\n",this.name);
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement