问题遇到的现象和发生背景
我的解答思路和尝试过的方法
String command = sc.nextLine();
if (command.equals("c")){
} else if (command.equals("create")) {
}
第二种是用switch
String command = sc.nextLine();
switch (command) {
case "c":
case "create":
createNewApplication();
break;
我想要达到的结果
想问问有没有其他的方式能简化if 这个代码呢?因为这两个最后输出的结果是一样的