Switch statement can be replaced with enhanced 'switch'
Switch语句可以替换为增强的“Switch”
switch(choiceSecond){
case "1":
this.delete();
break;
case "2":
this.buy();
break;
case "3":
empJudge = true;
break;
default:
System.out.println("非法输入,请重新键入命令");
}
switch (choiceSecond) {
case "1" -> this.delete();
case "2" -> this.buy();
case "3" -> empJudge = true;
default -> System.out.println("非法输入,请重新键入命令");
}
转载请注明原文地址:https://blackberry.8miu.com/read-4019.html