System.out.Println("Do you want to continue ?");
if
(choice.equalsIgnoreCase("yes")||choice.equalsIgnoreCase("y"))
{
LinkedTeams.createList();
}
else
(choice.equalsIgnoreCase("no")||choice.equalsIgnoreCase("n"))
错误发生在下面声明的其他部分,我现在想知道我做错了什么,因为我无法看到半冒号或常规麻烦的任何错误
{
MainMenu.MENU();
}
}while()
}
public static void printList()
{
currentNode=headNode;
while (currentNode!=null)
{
System.out.println(currentNode.pokemonName);
Im unable to differentiate the difference between the two
System.out.println(currentNode.pokemonType);
currentNode=currentNode.next;
Just unable to find enough information }
}
}
答案 0 :(得分:2)
System.out.Println("Do you want to continue ?");
if
(choice.equalsIgnoreCase("yes")||choice.equalsIgnoreCase("y"))
{
LinkedTeams.createList();
}
else if
(choice.equalsIgnoreCase("no")||choice.equalsIgnoreCase("n"))
其他不接受陈述,因为它已经达到了一个部分。添加“if”应该解决。
答案 1 :(得分:1)
您的意思是else if
而不只是else
:if-then and if-then-else statements。