HelloWorld.java:5: error: : expected case "一"; ^ HelloWorld.java:6: error: : expected case "三"; ^ HelloWorld.java:7: error: : expected case "五"; ^ HelloWorld.java:10: error: : expected case "二"; ^ HelloWorld.java:11: error: : expected case "四"; ^ HelloWorld.java:12: error: : expected case "六"; ^ HelloWorld.java:15: error: : expected default ; ^ 7 errors
为什么上面给的事例case 1case 2不用' 'case '一'要用引号
case'一':
case'三':
case'五':
System.out.println("吃包子");break;
case'日':
System.out.println("吃总统套餐");break;
default:
System.out.println("吃油条");
}
代码贴上来看下