Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. package com.gmail.kudr641.example1;
  2.  
  3. public class Cat {
  4. private int age;
  5. private int weight;
  6. public int getAge() {
  7. return age;
  8. }
  9.  
  10. public void setAge(int age) {
  11. this.age = age;
  12. }
  13.  
  14. public int getWeight() {
  15. return weight;
  16. }
  17.  
  18. public void setWeight(int weight) {
  19. this.weight = weight;
  20. }
  21.  
  22. public String getColor() {
  23. return color;
  24. }
  25.  
  26. public void setColor(String color) {
  27. this.color = color;
  28. }
  29.  
  30. public String getName() {
  31. return name;
  32. }
  33.  
  34. public void setName(String name) {
  35. this.name = name;
  36. }
  37.  
  38. private String color;
  39. private String name;
  40.  
  41. public Cat(int age, int weight, String color, String name){
  42. this.age = age;
  43. this.weight = weight;
  44. this.color = color;
  45. this.name = name;
  46. }
  47.  
  48. public void getVoice(){
  49. System.out.println("May - May");
  50. }
  51.  
  52. public void go(){
  53. System.out.println("Cat go");
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement