You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: concepts/exceptions/about.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,10 @@ An exception is an event that occurs during the execution of a program that disr
8
8
Exceptions are raised explicitly in Java, and the act of raising an exception is called _throwing an exception_.
9
9
The act of handling an exception is called _catching an exception_.
10
10
11
-
Java distinguishes three types of exceptions:
11
+
Java distinguishes two types of exceptions:
12
12
13
13
1. Checked exceptions
14
14
2. Unchecked exceptions
15
-
3. Errors
16
15
17
16
### Checked exceptions
18
17
@@ -21,7 +20,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh
21
20
22
21
This type of exception is checked at compile-time: methods that throw checked exceptions should specify this in their method signature, and code calling a method that might throw a checked exception is required to handle it or the code will not compile.
23
22
24
-
All exceptions in Java that do not inherit from `RuntimeException`or `Error`are considered checked exceptions.
23
+
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.
25
24
26
25
### Unchecked exceptions
27
26
@@ -30,17 +29,15 @@ An example of an unchecked exception is the `NullPointerException` which occurs
30
29
31
30
This type of exception is not checked at compile-time: methods that throw unchecked exceptions are not required to specify this in their method signature, and code calling a method that might throw an unchecked exception is not required to handle it.
32
31
33
-
All exceptions in Java that inherit from `RuntimeException` are considered unchecked exceptions.
32
+
All exceptions in Java that inherit from `RuntimeException` are unchecked exceptions.
34
33
35
-
###Errors
34
+
## Errors
36
35
37
-
_Errors_ are exceptional conditions that are external to an application.
38
-
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.
36
+
Java also has a separate category called _Errors_ which are serious problems that are external to an application. 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.
39
37
40
-
Like unchecked exceptions, errors are not checked at compile-time.
41
-
They are not usually thrown from application code.
38
+
Like unchecked exceptions, errors are not checked at compile-time and are not usually thrown from application code. Unlike exceptions, Errors represent serious system-level problems that applications should generally not attempt to catch or handle.
42
39
43
-
All exceptions in Java that inherit from `Error`are considered errors.
Copy file name to clipboardExpand all lines: concepts/exceptions/introduction.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,10 @@ An exception is an event that occurs during the execution of a program that disr
8
8
Exceptions are raised explicitly in Java, and the act of raising an exception is called _throwing an exception_.
9
9
The act of handling an exception is called _catching an exception_.
10
10
11
-
Java distinguishes three types of exceptions:
11
+
Java distinguishes two types of exceptions:
12
12
13
13
1. Checked exceptions
14
14
2. Unchecked exceptions
15
-
3. Errors
16
15
17
16
### Checked exceptions
18
17
@@ -21,7 +20,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh
21
20
22
21
This type of exception is checked at compile-time: methods that throw checked exceptions should specify this in their method signature, and code calling a method that might throw a checked exception is required to handle it or the code will not compile.
23
22
24
-
All exceptions in Java that do not inherit from `RuntimeException`or `Error`are considered checked exceptions.
23
+
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.
25
24
26
25
### Unchecked exceptions
27
26
@@ -30,17 +29,15 @@ An example of an unchecked exception is the `NullPointerException` which occurs
30
29
31
30
This type of exception is not checked at compile-time: methods that throw unchecked exceptions are not required to specify this in their method signature, and code calling a method that might throw an unchecked exception is not required to handle it.
32
31
33
-
All exceptions in Java that inherit from `RuntimeException` are considered unchecked exceptions.
32
+
All exceptions in Java that inherit from `RuntimeException` are unchecked exceptions.
34
33
35
-
###Errors
34
+
## Errors
36
35
37
-
_Errors_ are exceptional conditions that are external to an application.
38
-
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.
36
+
Java also has a separate category called _Errors_ which are serious problems that are external to an application. 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.
39
37
40
-
Like unchecked exceptions, errors are not checked at compile-time.
41
-
They are not usually thrown from application code.
38
+
Like unchecked exceptions, errors are not checked at compile-time and are not usually thrown from application code. Unlike exceptions, Errors represent serious system-level problems that applications should generally not attempt to catch or handle.
42
39
43
-
All exceptions in Java that inherit from `Error`are considered errors.
Copy file name to clipboardExpand all lines: exercises/concept/calculator-conundrum/.docs/introduction.md
+7-10Lines changed: 7 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,10 @@ An exception is an event that occurs during the execution of a program that disr
10
10
Exceptions are raised explicitly in Java, and the act of raising an exception is called _throwing an exception_.
11
11
The act of handling an exception is called _catching an exception_.
12
12
13
-
Java distinguishes three types of exceptions:
13
+
Java distinguishes two types of exceptions:
14
14
15
15
1. Checked exceptions
16
16
2. Unchecked exceptions
17
-
3. Errors
18
17
19
18
#### Checked exceptions
20
19
@@ -23,7 +22,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh
23
22
24
23
This type of exception is checked at compile-time: methods that throw checked exceptions should specify this in their method signature, and code calling a method that might throw a checked exception is required to handle it or the code will not compile.
25
24
26
-
All exceptions in Java that do not inherit from `RuntimeException`or `Error`are considered checked exceptions.
25
+
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.
27
26
28
27
#### Unchecked exceptions
29
28
@@ -32,17 +31,15 @@ An example of an unchecked exception is the `NullPointerException` which occurs
32
31
33
32
This type of exception is not checked at compile-time: methods that throw unchecked exceptions are not required to specify this in their method signature, and code calling a method that might throw an unchecked exception is not required to handle it.
34
33
35
-
All exceptions in Java that inherit from `RuntimeException` are considered unchecked exceptions.
34
+
All exceptions in Java that inherit from `RuntimeException` are unchecked exceptions.
36
35
37
-
####Errors
36
+
### Errors
38
37
39
-
_Errors_ are exceptional conditions that are external to an application.
40
-
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.
38
+
Java also has a separate category called _Errors_ which are serious problems that are external to an application. 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.
41
39
42
-
Like unchecked exceptions, errors are not checked at compile-time.
43
-
They are not usually thrown from application code.
40
+
Like unchecked exceptions, errors are not checked at compile-time and are not usually thrown from application code. Unlike exceptions, Errors represent serious system-level problems that applications should generally not attempt to catch or handle.
44
41
45
-
All exceptions in Java that inherit from `Error`are considered errors.
0 commit comments