forked from mxg133/learnforJava_DesignPattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonster.java
More file actions
executable file
·51 lines (43 loc) · 1023 Bytes
/
Monster.java
File metadata and controls
executable file
·51 lines (43 loc) · 1023 Bytes
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
50
51
package bean;
public class Monster {
private Integer id = 10 ;
private String nickname = "牛魔王";
private String skill = "芭蕉扇";
public Monster() {
System.out.println("monster 创建..");
}
public Monster(Integer id, String nickname, String skill) {
//System.out.println("Integer id, String nickname, String skill被调用");
this.id = id;
this.nickname = nickname;
this.skill = skill;
}
public Monster( String nickname, String skill,Integer id) {
this.id = id;
this.nickname = nickname;
this.skill = skill;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getSkill() {
return skill;
}
public void setSkill(String skill) {
this.skill = skill;
}
@Override
public String toString() {
return "Monster [id=" + id + ", nickname=" + nickname + ", skill="
+ skill + "]";
}
}