init
This commit is contained in:
36
Question20-InstanceBasicOperation/src/Dog.java
Normal file
36
Question20-InstanceBasicOperation/src/Dog.java
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
public class Dog {
|
||||
private String name;
|
||||
private int age;
|
||||
private Toys toys;
|
||||
|
||||
public Dog(String name, int age, Toys toys) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
this.toys = toys;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public Toys getToys() {
|
||||
return toys;
|
||||
}
|
||||
|
||||
public void setToys(Toys toys) {
|
||||
this.toys = toys;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user