java中“throw new Exception()” 和“new Exception()”区别

来源:学生作业帮助网 编辑:六六作业网 时间:2024/07/14 01:25:13
java中“thrownewException()”和“newException()”区别java中“thrownewException()”和“newException()”区别java中“thro

java中“throw new Exception()” 和“new Exception()”区别
java中“throw new Exception()” 和“new Exception()”区别

java中“throw new Exception()” 和“new Exception()”区别
一个是抛出异常类Exception的对象,即手动抛出异常.
一个是新建一个异常类Exception的对象,但并不抛出.