由于某种原因,String[] champs 没有被实例化,我似乎看不出为什么
不应该 champs = new String[]{ "BLAH", "BLAH", "BLAH"};
初始化数组?
public static String[] getChamps() {
String rolereturn = ChampSelect.getRoles();
//Switch to Determine Champion Suggestions
String[] champs; //String Declaration
switch (rolereturn) {
case "AD Carry": //AD Carry Selection Options
champs = new String[]{ "Ashe", "Caityln", "Draven", "Ezreal", "Kog'Maw", "Sivir", "Twitch", "Varus", "Vayne" };
break;
case "AP Carry": //AP Carry Selection Options
champs = new String[]{ "Diana", "Evelyn", "Kassadin", "Kennen" };
break;
case "Support": //Support Selection Options
champs = new String[]{ "Janna", "Nunu", "Shen", "Soraka", "Taric", };
break;
case "AP Jungle": //AP Jungle Selection Options
champs = new String[]{ "Diana", "Fiddlesticks" };
break;
case "AD Jungle": //AD Jungle Selection Options
champs = new String[]{ "Kha'Zix", "Nocturne", "Rengar", "Udyr", "Warwick", };
break;
case "AP Top": //AP Top Selection Options
champs = new String[]{ "Akali", "Cho'Gath", "Kennen", "Malphite", "Shen", "Singed", "Teemo" };
break;
case "AD Top": //AD Top Selection Options
champs = new String[]{ "Fiora", "Irelia", "Jax", "Kha'Zix", "Master Yi", "Nasus", "Nidalee", "Rengar", "Zed" };
break;
}
return champs;
}