高高高高?。。?!手求解
public class HelloWorld {
??? public static void main(String[] args) {
?? ??? ?char today= '7';
?? ??? ?switch (today){
?? ??? ???? case '1':
?? ??? ???? case '3':
?? ??? ???? case '5':
?? ??? ???? System.out.println("早餐吃稀飯包子");
?? ??? ???? break;
?? ??? ???? case '2':
?? ??? ???? case '4':
?? ??? ???? case '6':
?? ??? ???? System.out.println("早餐吃油條");
?? ??? ???? break;
?? ??? ???? default:
?? ??? ???? System.out.println("吃主席套餐");
?? ??? ?}
?????? ?
??? }
?? ?
}
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?????? ?
?? ?}
}
錯在哪里
2017-01-23
ublic?class?HelloWorld?{ ????public?static?void?main(String[]?args)?{ ????????char?today=?'7'; ????????switch?(today){ ????????????case?'1': ????????????case?'3': ????????????case?'5': ????????????????System.out.println("早餐吃稀飯包子"); ????????????????break; ????????????case?'2': ????????????case?'4': ????????????case?'6': ????????????????System.out.println("早餐吃油條"); ????????????????break; ????????????default: ????????????????System.out.println("吃主席套餐"); ????????}???? ????}?? }1.System.out語句和break語句都要空兩格;
2.最下面的兩個}}去掉。