异常匹配:catch子句查找的时候并不要求抛出的异常同程序所声明的异常完全匹配
class Annoyance extends Exception{}class Sneeze extends Annoyance{}public class Human {public static void main(String[] args) {/* try {throw new Sneeze();} catch (Sneeze sneeze) {sneeze.printStackTrace();} catch (Annoyance annoyance){annoyance.printStackTrace();}*/try {throw new Sneeze();}catch (Annoyance annoyance){//会捕获Annoyance以及所有从它派生的异常annoyance.printStackTrace();}}}
