package com.zhanzhuang.exception; public class CustomizeException { public static void main(String[] args) { judge(); } public static void judge() { int a = 2; int b = 1; if (a > b) { try { throw new MyException("true"); } catch (MyException…
/** * Return whether the given throwable is a checked exception: * that is, neither a RuntimeException nor an Error. * @param ex the throwable to check * @return whether the throwable is a checked exception * @see java.lang.Exception * @see java.lang…
本来想在类的顶部设置一个 静态的SimpleDateFormat常量 public final static DateFormat dateFormatGMT = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss z", Locale.ENGLISH); 供多个线程使用,但用了一个星期后,在今天晚上发现抛出两个异常. 当时的线程数应该在 30个左右. 我一直认为是线程安全的,但是今天抛出这个异常: Exception in thread &q…