中断语句在 “if else” - java
2022-09-02 19:32:47
我不断收到错误,没有.if
else
我也试过了else if
for (;;){
System.out.println("---> Your choice: ");
choice = input.nextInt();
if (choice==1)
playGame();
if (choice==2)
loadGame();
if (choice==3)
options();
if (choice==4)
credits();
if (choice==5)
System.out.println("End of Game\n Thank you for playing with us!");
break;
else
System.out.println("Not a valid choice!\n Please try again...\n");=[;'mm
}
另外,如果您对如何呈现此代码有更好的想法,请不要犹豫:)