Skip to content
Merged
17 changes: 8 additions & 9 deletions concepts/exceptions/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ An exception is an event that occurs during the execution of a program that disr
Exceptions are raised explicitly in Java, and the act of raising an exception is called _throwing an exception_.
The act of handling an exception is called _catching an exception_.

Java distinguishes three types of exceptions:
Java distinguishes two types of exceptions:

1. Checked exceptions
2. Unchecked exceptions
3. Errors

### Checked exceptions

Expand All @@ -21,7 +20,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh

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.

All exceptions in Java that do not inherit from `RuntimeException` or `Error` are considered checked exceptions.
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.

### Unchecked exceptions

Expand All @@ -30,17 +29,17 @@ An example of an unchecked exception is the `NullPointerException` which occurs

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.

All exceptions in Java that inherit from `RuntimeException` are considered unchecked exceptions.
All exceptions in Java that inherit from `RuntimeException` are unchecked exceptions.

### Errors
## Errors

_Errors_ are exceptional conditions that are external to an application.
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.

Like unchecked exceptions, errors are not checked at compile-time.
They are not usually thrown from application code.
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.

All exceptions in Java that inherit from `Error` are considered errors.
All errors in Java inherit from the `Error` class.

## Throwing exceptions

Expand Down
17 changes: 8 additions & 9 deletions concepts/exceptions/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ An exception is an event that occurs during the execution of a program that disr
Exceptions are raised explicitly in Java, and the act of raising an exception is called _throwing an exception_.
The act of handling an exception is called _catching an exception_.

Java distinguishes three types of exceptions:
Java distinguishes two types of exceptions:

1. Checked exceptions
2. Unchecked exceptions
3. Errors

### Checked exceptions

Expand All @@ -21,7 +20,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh

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.

All exceptions in Java that do not inherit from `RuntimeException` or `Error` are considered checked exceptions.
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should mention the Exception class somewhere since RuntimeException extends Exception.


### Unchecked exceptions

Expand All @@ -30,17 +29,17 @@ An example of an unchecked exception is the `NullPointerException` which occurs

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.

All exceptions in Java that inherit from `RuntimeException` are considered unchecked exceptions.
All exceptions in Java that inherit from `RuntimeException` are unchecked exceptions.

### Errors
## Errors
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Errors has been "promoted' to a level 2 heading, it looks like it sitting in between two Exception sections. I think it might flow better if this was moved after the Handling Exception section so that the entire Exception content was "together".


_Errors_ are exceptional conditions that are external to an application.
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.

Like unchecked exceptions, errors are not checked at compile-time.
They are not usually thrown from application code.
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion to emphasize the difference between unchecked exceptions and errors.

Suggested change
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.
Like unchecked exceptions, errors are not checked at compile-time.
The difference is that they represent system level problems and are generally thrown by the Java Virtual machine or environment instead of the application.
Applications should generally not attempt to catch or handle them.


All exceptions in Java that inherit from `Error` are considered errors.
All errors in Java inherit from the `Error` class.

## Throwing exceptions

Expand Down
17 changes: 8 additions & 9 deletions exercises/concept/calculator-conundrum/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ An exception is an event that occurs during the execution of a program that disr
Exceptions are raised explicitly in Java, and the act of raising an exception is called _throwing an exception_.
The act of handling an exception is called _catching an exception_.

Java distinguishes three types of exceptions:
Java distinguishes two types of exceptions:

1. Checked exceptions
2. Unchecked exceptions
3. Errors

#### Checked exceptions

Expand All @@ -23,7 +22,7 @@ An example of a checked exception is the `FileNotFoundException` which occurs wh

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.

All exceptions in Java that do not inherit from `RuntimeException` or `Error` are considered checked exceptions.
All exceptions in Java that do not inherit from `RuntimeException` are checked exceptions.

#### Unchecked exceptions

Expand All @@ -32,17 +31,17 @@ An example of an unchecked exception is the `NullPointerException` which occurs

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.

All exceptions in Java that inherit from `RuntimeException` are considered unchecked exceptions.
All exceptions in Java that inherit from `RuntimeException` are unchecked exceptions.

#### Errors
### Errors

_Errors_ are exceptional conditions that are external to an application.
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.

Like unchecked exceptions, errors are not checked at compile-time.
They are not usually thrown from application code.
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.

All exceptions in Java that inherit from `Error` are considered errors.
All errors in Java inherit from the `Error` class.

### Throwing exceptions

Expand Down
Loading