求一个解决方案,谢谢
package zh.codegym.task.task15.task1517;
/*
Static 修饰符和异常
*/
public class Solution {
public static int A = 0;
static {
// 在此抛出异常
try {
throw new Exception();
} catch (Exception e) {
throw e;
}
}
public static int B = 5;
public static void main(String[] args) {
System.out.println(B);
}
}