【发布时间】:2023-03-24 08:11:01
【问题描述】:
我在这部分代码中不断收到错误 Illegal start of expression。
switch(length) {
case 1: if(message.equalsIgnoreCase("End")){
throws new AnotherException("Stop",true);
} else {
throws new AnotherException("Continue",false);
}
break;
}
特别是如果我添加
throw new AnotherException
有人可以解释导致此错误的原因吗?谢谢。
【问题讨论】:
-
“这部分”有点宽泛
标签: java exception switch-statement custom-exceptions throws