Skip to content

Commit debab47

Browse files
committed
Clarify error vs unchecked exception
1 parent f27f57c commit debab47

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

concepts/exceptions/introduction.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ Current balance: 5.0
131131
Java also has a separate category called _Errors_ which are serious problems that are external to an application.
132132
An example of an error is the `OutOfMemoryError` which occurs when an application is trying to use more memory than is available on the system.
133133

134-
Like unchecked exceptions, errors are not checked at compile-time and are not usually thrown from application code.
135-
Unlike exceptions, Errors represent serious system-level problems that applications should generally not attempt to catch or handle.
134+
Like unchecked exceptions, errors are not checked at compile-time.
135+
The difference is that they represent system level problems and are generally thrown by the Java Virtual machine or environment instead of the application.
136+
Applications should generally not attempt to catch or handle them.
136137

137138
All errors in Java inherit from the `Error` class.

0 commit comments

Comments
 (0)