[Java] Phân cấp ngoại lệ Java - Java Exceptions Hierarchy

ID Topic: 39076 • Có 69 lượt xem
Hình đại diện của thành viên
#1 - @618500
01/09/2024 00:50
- The class at the top of the exception class hierarchy is the Throwable class, which is a direct subclass of the Object class
- Throwable has two direct subclasses:
+ Exception
+ Error

- The Exception class is used for exception conditions that the application may need to handle. Examples of exceptions include IllegalArgumentException, ClassNotFoundException and NullPointerException.
- The Error class is used to indicate a more serious problem in the architecture and should not be handled in the application code. Examples of errors include InternalError, OutOfMemoryError and AssertionError.
- Exceptions are further subdivided into checked (compile-time) and unchecked (run-time) exceptions. All subclasses of RuntimeException are unchecked exceptions, whereas all subclasses of Exception besides RuntimeException are checked exceptions.


[Java] Phân cấp ngoại lệ Java - Java Exceptions Hierarchy
(Google Chrome Browser)
PM|Trích|Like|Sửa|Xóa|Báo cáo|Cảnh cáo
Trả lời nhanh

Chủ đề tương tự