package com.xy; import java.util.*; class MinusException extends ArithmeticException { public MinusException() { } public MinusException(String str) { super(str); } } class OverException extends ArithmeticException { public OverException() { }
public OverException(String str) { super(str); } } public class TestScore { public static void judgescore(int i) throws MinusException, OverException { if (i < 0) throw new MinusException("分数不能为负数"); if (i > 100) throw new OverException("分数超过100,过大!"); }
public static void main(String[] args) { int array[] = { 0, 0 }; int turn = 1; double total = 0; Scanner input = new Scanner(System.in); int score = 0; System.out.println("请输入学生成绩,输入-1退出:"); System.out.print("请输入" + turn + "个学生成绩:"); score = input.nextInt(); while (score != -1) { try {
} } 出错提示:java.lang.VerifyError: (class: com/xy/TestScore, method: main signature: ([Ljava/lang/String;)V) catch_type not a subclass of Throwable Exception in thread "main" 不懂是什么意思。