Java异常机制中的问题

来源:互联网 发布:单色led显示屏软件 编辑:程序博客网 时间:2024/05/19 23:09
    public void test(){        try{            System.out.println();            throw new Exception();        }catch (Exception e){            System.out.println();            throw e;        }    }

上面的代码中会报错:Unhandle Exception: java.lang.Exception,但是下面的代码却不会

    public void test(){        try{            System.out.println();            //throw new Exception();        }catch (Exception e){            System.out.println();            throw e;        }    }

为什么???