-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #343 from hwanghe159/item72
[#72][2κΈ°] νμ€ μμΈλ₯Ό μ¬μ©νλΌ
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## μμ΄ν 72. νμ€ μμΈλ₯Ό μ¬μ©νλΌ | ||
|
||
μ¬λ§νλ©΄ μ½λλ μ¬μ¬μ©νλ κ² μ’λ€. μμΈλ λ§μ°¬κ°μ§λ‘ μ§μ λ§λλ κ²λ³΄λ¨ νμ€ μμΈλ₯Ό μ¬μ©νλ κ² μ’λ€ | ||
|
||
### νμ€ μμΈλ₯Ό μ¬μ¬μ©νλ©΄ μ»λ μ₯μ | ||
|
||
1. λ€λ₯Έ μ¬λμ΄ μ΅νκ³ μ¬μ©νκΈ° μ¬μμ§λ€, κ°λ μ±μ΄ μ’μμ§λ€ | ||
2. μμΈ ν΄λμ€κ° μ μμλ‘ λ©λͺ¨λ¦¬ μ¬μ©λλ μ€κ³ ν΄λμ€λ₯Ό μ μ¬νλ μκ°λ μ κ² κ±Έλ¦°λ€ | ||
- μμΈλ μ§λ ¬νν μ μλ€ -> μ§λ ¬νμ λ§μ λΆλ΄μ΄ λ°λ₯Έλ€ | ||
|
||
### λ§μ΄ μ°μ΄λ νμ€ μμΈ | ||
|
||
- `IllegalArgumentException` | ||
- νΈμΆμκ° μΈμλ‘ λΆμ μ ν κ°μ λκΈΈ λ | ||
- μ: λ°λ³΅ νμλ₯Ό μ§μ νλ 맀κ°λ³μμ μμλ₯Ό κ±΄λ¬ λ | ||
- `IllegalStateException` | ||
- λμ κ°μ²΄μ μνκ° νΈμΆλ λ©μλλ₯Ό μννκΈ°μ μ ν©νμ§ μμ λ | ||
- μ: μ λλ‘ μ΄κΈ°νλμ§ μμ κ°μ²΄λ₯Ό μ¬μ©νλ € ν λ | ||
- `NullPointerException` | ||
- nullκ°μ νμ©νμ§ μλ λ©μλμ nullμ κ±΄λ¬ λ | ||
- `IndexOutOfBoundsException` | ||
- μ΄λ μνμ€μ νμ© λ²μλ₯Ό λλ κ°μ κ±΄λ¬ λ | ||
- μΈλ±μ€κ° λ²μλ₯Ό λμ΄μ°μ λ | ||
- `ConcurrentModificationException` | ||
- λ¨μΌ μ€λ λμμ μ¬μ©νλ €κ³ μ€κ³ν κ°μ²΄λ₯Ό μ¬λ¬ μ€λ λκ° λμμ μμ νλ €κ³ ν λ | ||
- λμ μμ μ νμ€ν κ²μΆν μ μλ μμ λ λ°©λ²μ΄ μμΌλ, μ΄ μμΈλ λ¬Έμ κ° μκΈΈ κ°λ₯μ±μ μλ €μ£Όλ μ λμ μν λ‘ μ°μ | ||
- `UnsupportedOperationException` | ||
- ν΄λΌμ΄μΈνΈκ° μμ²ν λμμ λμ κ°μ²΄κ° μ§μνμ§ μμ λ | ||
- 보ν΅μ ꡬννλ €λ μΈν°νμ΄μ€μ λ©μλ μΌλΆλ₯Ό ꡬνν μ μμλ μ¬μ© | ||
- μ : μμλ₯Ό λ£μμλ§ μλ `List`μ ꡬν체μ `remove`λ©μλλ μ΄ μμΈλ₯Ό λμ§ | ||
- `ArithmeticException`, `NumberFormatException`, .. | ||
- 볡μμλ μ 리μλ₯Ό λ€λ£¨λ κ°μ²΄μμ μ¬μ© | ||
|
||
### `Exception`, `RuntimeException`, `Throwable`, `Error`μ μ§μ μ¬μ¬μ©νμ§ λ§λΌ | ||
|
||
- μ΄ ν΄λμ€λ€μ μΆμ ν΄λμ€λΌκ³ μκ°νλ κ² λ«λ€ | ||
- μμ ν΄λμ€μ΄λ―λ‘(μ¬λ¬ μ±κ²©μ μμΈλ€μ ν¬κ΄νλ ν΄λμ€μ΄λ―λ‘) μμ μ μΌλ‘ ν μ€νΈν μ μλ€ | ||
|
||
### νμ€ μμΈμ€μ μ΄λ€ κ±Έ μ¬μ©ν΄μΌ ν μ§ ν·κ°λ¦°λ€λ©΄? | ||
|
||
- νμ€ μμΈλ€μ μ£Όμ μ°μμ΄ μνΈ λ°°νμ μ΄μ§ μκΈ° λλ¬Έμ μ ννκΈ° μ΄λ €μΈ μ μλ€ | ||
- μ: μΉ΄λ λ±μ νννλ κ°μ²΄κ° μκ³ , μΉ΄λλ₯Ό λ½μ λλ μ£Όλ λ©μλ(μΈμλ‘ κ±΄λ¨ μλ§νΌ)κ° μμλ | ||
- μΈμκ° λ무 컀μ μ΄μ°¨νΌ μ€ν¨ν κ±°λΌλ©΄? -> `IllegalArgumentException` | ||
- λ±μ μΉ΄λκ° λ무 μ μΌλ©΄? -> `IllegalStateException` |