day11--引用类型作为成员变量类型(hero,weapon,armor,skill)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.inmind.test05;
|
||||
|
||||
//装备类
|
||||
public class Armor {
|
||||
//名称
|
||||
private String name;
|
||||
//防御值
|
||||
private int protectedNum;
|
||||
|
||||
public Armor(String name, int protectedNum) {
|
||||
this.name = name;
|
||||
this.protectedNum = protectedNum;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getProtectedNum() {
|
||||
return protectedNum;
|
||||
}
|
||||
|
||||
public void setProtectedNum(int protectedNum) {
|
||||
this.protectedNum = protectedNum;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user