-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerson.java
49 lines (38 loc) · 902 Bytes
/
Person.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package java_json;
public class Person {
private String name = "Tanglong";
private String address = "HangZhou";
private boolean isboy = true;
public Person(){};
public Person(String name, boolean isboy){
this.name = name;
this.isboy = isboy;
}
public Person(String name,boolean isboy,String address){
this(name, isboy);
this.address = address;
}
@Override
public String toString(){
return String.format("[Name:%s,isboy:%s,Address:%s]",name,isboy,address);
}
// getter and setter
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public boolean isIsboy() {
return isboy;
}
public void setIsboy(boolean isboy) {
this.isboy = isboy;
}
}