File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -401,10 +401,11 @@ final关键字主要用在三个地方:变量、方法、类。
401
401
**注意:异常和错误的区别:异常能被程序本身可以处理,错误是无法处理。**
402
402
403
403
### Trowable类常用方法
404
- **public string getMessage ()**:返回异常发生时的详细信息
405
- **public string toString ()**:返回异常发生时的简要描述
406
- **public string getLocalizedMessage ()**:返回异常对象的本地化信息。使用Throwable的子类覆盖这个方法,可以声称本地化信息。如果子类没有覆盖该方法,则该方法返回的信息与getMessage()返回的结果相同
407
- **public void printStackTrace ()**:在控制台上打印Throwable对象封装的异常信息
404
+
405
+ - **public string getMessage ()**:返回异常发生时的详细信息
406
+ - **public string toString ()**:返回异常发生时的简要描述
407
+ - **public string getLocalizedMessage ()**:返回异常对象的本地化信息。使用Throwable的子类覆盖这个方法,可以声称本地化信息。如果子类没有覆盖该方法,则该方法返回的信息与getMessage()返回的结果相同
408
+ **public void printStackTrace ()**:在控制台上打印Throwable对象封装的异常信息
408
409
409
410
### 异常处理总结
410
411
You can’t perform that action at this time.
0 commit comments