Skip to content

Commit 85e331f

Browse files
authored
Fix the definition of unchecked exception in the error-handling exercise instructions (#2814)
* Clarify the meaning of unchecked exceptions in the documentation * Also fix a grammar error in the error-handling exercise instructions
1 parent 18ff81d commit 85e331f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exercises/practice/error-handling/.docs/instructions.append.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This is because checked exceptions are meant to be handled at runtime, i.e. they
2222

2323
They're often used when a method can't return any valid result, for example a search method which hasn't found the item it was searching for.
2424

25-
It's an alternative to returning null or a error code. A checked exception is better than those alternatives because it forces the user of the method to consider the error case.
25+
It's an alternative to returning null or an error code. A checked exception is better than those alternatives because it forces the user of the method to consider the error case.
2626

2727
## Unchecked exceptions
2828

@@ -34,4 +34,4 @@ You don't have to declare them in the [method signature](https://docs.oracle.com
3434

3535
### Examples of where they are used
3636

37-
Unchecked exceptions are mean to be used for any error than can't be handled at runtime, e.g. running out of memory.
37+
Unchecked exceptions are typically caused by defects in the program and can be prevented by proper coding. Example: ArrayIndexOutOfBoundsException can be prevented by ensuring that the array indices are between 0 and the array's length.

0 commit comments

Comments
 (0)