switch(month){
case 1|3|5|7|8|10|12:
System.out.println(month+"月有31天");
break;
case 4|6|9|11:
System.out.println(month+"月有30天");
break;
default:
System.out.println(month+"月有28天");
}
这是我的代码,判断月份的天数,如果注释第二个case不会报错,但不注释就会报错。java中可以这样写吗