我正在制作一个游戏的代码,但在一个特定的类中,我似乎从一个简单的系统中得到一个错误.out.println我是刚刚开始编程的新手,我知道这是一个基本的错误,但我真的不
public static int victory1(){
String[] weaponName = {"Fist","Iron Sword","Metal Dick Axe",
};
int[] weaponDamage = {2,4,6
};
String[] armorName = { "Iron Leather Coat",
};
int[] armorDef = { 4,
};
System.out.println("After defeating the Iron Leathered Boar you decide wether to make an armor or a sword out of its skin.\n"
+ "1)Craft Armor (Obtain"+armorName[0]+")"" +"+armorDef[0]+" Armor\n"
+ "2)Craft Sword (Obtain"+weaponName[1]+")"" +"+armorDef[1]+" Damage");
}
}
答案 0 :(得分:0)
更改
"1)Craft Armor (Obtain"+armorName[0]+")"" +"+armorDef[0]+" Armor\n"
"2)Craft Sword (Obtain"+weaponName[1]+")"" +"+armorDef[1]+" Damage");
到
"1)Craft Armor (Obtain"+armorName[0]+")"+armorDef[0]+" Armor\n"
"2)Craft Sword (Obtain"+weaponName[1]+")"+armorDef[1]+" Damage");