代码分析

Cat.java

 1 package com.ftl.petshop;
 2 
 3 class Cat implements Pet
 4 {
 5     private String name;
 6     private String color;
 7     private int age;
 8     public Cat(String name, String color, int age)
 9     {
10         this.name = name;
11         this.color = color;
12         this.age = age;
13     }
14     public String getName()
15     {
16         return name;
17     }
18     public void setName(String name)
19     {
20         this.name = name;
21     }
22     public String getColor()
23     {
24         return color;
25     }
26     public void setColor(String color)
27     {
28         this.color = color;
29     }
30     public int getAge()
31     {
32         return age;
33     }
34     public void setAge(int age)
35     {
36         this.age = age;
37     }
38     
39 }
View Code

相关文章:

  • 2021-11-01
  • 2021-11-29
  • 2021-11-29
  • 2021-11-27
  • 2021-10-04
  • 2021-11-01
  • 2021-12-14
  • 2021-11-22
猜你喜欢
  • 2022-01-01
  • 2022-01-01
  • 2021-09-24
  • 2021-12-31
  • 2021-09-29
  • 2021-11-29
  • 2021-11-01
相关资源
相似解决方案