static class UserException extends Exception{ UserException(){ super("数据为负"); } }
这个应该是if 简写了,idea提示不影响代码执行,if(n<0 || m<0){ throw new UserException();}