java7里的multi-catch...半吊子的语法糖
public class Main {public static class A extends RuntimeException{}public static class B extends RuntimeException{}public static void throwRuntimeException(){if(Math.random()>=Math.random()){throw new A();}else{throw new B();}}public static void use(A a){}public static void use(B b){}public static void main(String[] args) {try{throwRuntimeException();}catch (A e) {use(e);}catch (B e) {use(e);}//oktry{throwRuntimeException();}catch (A|B e) {use(e);}//编译不通过,找不到use(RuntimeException);multicatch导致类型退化.这块糖我吃不起}}