- Java
- 2018-01-26 23:23:36 @
package gun;
public class Gun {
private char name;
private float attack;
private char color;
public char getName() {
return name;
}
public void setName(char name) {
this.name = name;
}
public float getActtck() {
return attack;
}
public void setAttack(float attack) {
this.attack = attack;
}
public char getColor() {
return color;
}
public void setColor(char color) {
this.color = color;
}
public Gun(char newName,float newAttack,char newColor){
name=newName;
attack=newAttack;
color=newColor;
System.out.println("无意思");
}
public Gun() {
// TODO Auto-generated constructor stub
}
}
package gun;
public class Gun2 {
private static char AK47;
private static char red;
public static void main(String[] args){
Gun gun=new Gun();
Gun gun2=new Gun(AK47,1.4f,red);
gun2.setAttack(1.8f);
System.out.println("acttack:"+gun.getActtck());
}
}