-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: π° [Item 68] μΌλ°μ μΌλ‘ ν΅μ©λλ λͺ
λͺ
κ·μΉμ λ°λ₯΄λΌ
- Loading branch information
1 parent
1b6066f
commit cc5d096
Showing
1 changed file
with
111 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,111 @@ | ||
--- | ||
title: Item 68 - μΌλ°μ μΌλ‘ ν΅μ©λλ λͺ λͺ κ·μΉμ λ°λ₯΄λΌ | ||
date: 2024-05-12 14:07:00 +0900 | ||
categories: [μ΄νν°λΈ μλ°, chapter9] | ||
tags: [μ΄νν°λΈ μλ°] | ||
--- | ||
|
||
## **μλ° μΈμ΄μ λͺ λͺ κ·μΉ π―** | ||
|
||
> μ² μμ λ¬Έλ² λ λ²μ£Όλ‘ λλλ€. | ||
## **μ² μ κ·μΉ βοΈ** | ||
|
||
- ν¨ν€μ§, ν΄λμ€, μΈν°νμ΄μ€, λ©μλ, νλ νμ λ³μμ μ΄λ¦μ λ€λ£¬λ€. | ||
- νΉλ³ν μ΄μ κ° μλ ν **λ°λμ λ°λΌμΌ νλ€.** | ||
|
||
### **ν¨ν€μ§ λͺ λͺ λ²** | ||
|
||
- `.`μΌλ‘ ꡬλΆνμ¬ κ³μΈ΅μ μΌλ‘ μ΄λ¦μ μ§λλ€. | ||
- λ³΄ν΅ μΈν°λ· λλ©μΈ μ΄λ¦μ μμμΌλ‘ μ¬μ©νλ€. | ||
- ex) `edu.cmu`, `com.google` | ||
- νμ€ λΌμ΄λΈλ¬λ¦¬ λ° μ νμ ν¨ν€μ§λ€μ `java`μ `javax`λ‘ μμνλ€. | ||
- μ΄λ¦μ λ³΄ν΅ 8μ μ΄νμ 짧μ λ¨μ΄ νΉμ μ½μ΄λ‘ νλ€. | ||
- `utilities` β `util` | ||
- `abstract window toolkit` β `awt` | ||
|
||
### **ν΄λμ€μ μΈν°νμ΄μ€ λͺ λͺ λ²** | ||
|
||
- μ΄κ±°νμ , μ λν μ΄μ λ ν΄λμ€ νΉμ μΈν°νμ΄μ€λ‘ λ³Έλ€. | ||
- κ° λ¨μ΄λ λλ¬Έμλ‘ μμνλ€. | ||
- λ리 ν΅μ©λλ μ€μλ§(max, min λ±)μ μ μΈνκ³ λ λ¨μ΄λ₯Ό μ€μ¬ μ°μ§ μλλ€. | ||
- μ½μμ κ²½μ°, 첫 κΈμλ§ λλ¬Έμλ‘ ν μ§ μ½κ°μ λ Όμμ΄ μμΌλ, 첫 κΈμλ§ λλ¬Έμλ‘ νλ κ² μμ보기 μ’λ€. | ||
- ex) `HttpUrl` vs `HTTPURL` | ||
- μ 체λ₯Ό λλ¬Έμλ‘ νλ©΄ μ΄λμ λμ΄ μ½μ΄μΌ νλμ§ κ΅¬λΆμ΄ μ΄λ ΅λ€. | ||
|
||
### **λ©μλμ νλ μ΄λ¦ λͺ λͺ λ²** | ||
|
||
- 첫 κΈμλ₯Ό μλ¬Έμλ‘ νλ κ² μ΄μΈμλ ν΄λμ€, μΈν°νμ΄μ€ λͺ λͺ λ²κ³Ό λμΌνλ€. | ||
- ex) `remove()`, `ensureCapacity()` | ||
|
||
### **μμ νλ λͺ λͺ λ²** | ||
|
||
- μμ νλλ? | ||
- `enum`μ μ΄κ±° μ΄λ¦λ€ | ||
- `static final` μ κ·Ό μ μ΄μλ‘ ννλλ νλ | ||
- λͺ¨λ λλ¬Έμλ‘ μ°λ©°, λ¨μ΄ μ¬μ΄λ λ°μ€λ‘ ꡬλΆνλ€. | ||
- ex) `VALUES`, `NEGATIVE_INFINITY` | ||
|
||
### **μ§μ λ³μ λͺ λͺ λ²** | ||
|
||
- λ¬Έλ§₯μμ μλ―Έλ₯Ό μ½κ² μ μΆν μ μλ κ²½μ°μ νν΄ μ½μ΄λ₯Ό μ¨λ λλ€. | ||
- μ λ ₯ 맀κ°λ³μλ μ§μ λ³μμ μΌμ’ μΌλ‘ λ³Έλ€. | ||
|
||
### **νμ 맀κ°λ³μ(μ λ€λ¦) λͺ λͺ λ²** | ||
|
||
- T: μμμ νμ μ λ§νλ€. | ||
- E: 컬λ μ μμμ νμ μ λ§νλ€. | ||
- K, V: 맡μ ν€μ κ°μ λ§νλ€. | ||
- X: μμΈλ₯Ό λ§νλ€. | ||
- R: λ©μλμ λ°ν νμ μ λ§νλ€. | ||
- T, U, V, T1, T2, T3: μμμ νμ μνμ€λ₯Ό λ§νλ€. | ||
|
||
## **λ¬Έλ² κ·μΉ βοΈ** | ||
|
||
- μ² μ κ·μΉκ³Ό λΉκ΅νμ λ, λ μ μ°νκ³ λ Όλλ λ§λ€. | ||
|
||
### **ν΄λμ€μ μΈν°νμ΄μ€** | ||
|
||
- κ°μ²΄λ₯Ό μμ±ν μ μλ ν΄λμ€(μ΄κ±° νμ ν¬ν¨)μ μ΄λ¦μ λ¨μ λͺ μ¬λ λͺ μ¬κ΅¬λ₯Ό μ¬μ©νλ€. | ||
- ex) `Thread`, `PriorityQueue`, `ChessPiece` | ||
- κ°μ²΄λ₯Ό μμ±ν μ μλ ν΄λμ€λΌλ©΄, λ³΄ν΅ λ³΅μν λͺ μ¬λ‘ μ§λλ€. | ||
- ex) `Collectors`, `Collections` | ||
- μΈν°νμ΄μ€μ μ΄λ¦μ ableνΉμ ibleλ‘ λλλ νμ©μ¬λ‘ μ§κ±°λ ν΄λμ€μ λκ°μ΄ μ§λλ€. | ||
- ex) `Runnable`, `Iterable`, `Accessible` / `Collection`, `Comparator` | ||
|
||
### **μ λν μ΄μ ** | ||
|
||
- μ λν μ΄μ μ μ§λ°°μ μΈ κ·μΉ μμ΄ λͺ μ¬, λμ¬, μ μΉμ¬, νμ©μ¬ λ루 μ΄λ€. | ||
- ex) `BindingAnnotation`, `Inject`, `ImplementedBy`, `Singleton` | ||
|
||
### **λ©μλ** | ||
|
||
- λμμ μννλ λ©μλμ μ΄λ¦μ λμ¬λ λμ¬κ΅¬λ‘ μ§λλ€. | ||
- ex) `append`, `drawImage` | ||
- `boolean`κ°μ λ°ννλ λ©μλλ λ³΄ν΅ isλ hasλ‘ μμνκ³ , λͺ μ¬, λͺ μ¬κ΅¬, νΉμ νμ©μ¬λ‘ κΈ°λ₯νλ μ무 λ¨μ΄λ κ΅¬λ‘ λλλλ‘ μ§λλ€. | ||
- ex) `isDigit`, `isProbablePrime`, `isEmpty`, `isEnabled`, `hasSiblings` | ||
- λ°ν νμ μ΄ `boolean`μ΄ μλκ±°λ, μμ±μ λ°ννλ λ©μλλ λͺ μ¬, λͺ μ¬κ΅¬, νΉμ `get`μΌλ‘ μμνλ λμ¬κ΅¬λ‘ μ§λλ€. | ||
- ex) `size`, `hashCode`, `getTime` | ||
- κ°μ²΄μ νμ μ λ°κΏμ λ€λ₯Έ νμ μ κ°μ λ΄μ©μ κ°μ²΄λ₯Ό λ°νν λλ `toType`ννλ‘ μ§λλ€. | ||
- ex) `toString`, `toArray` | ||
- κ°μ²΄μ λ΄μ©μ λ€λ₯Έ λ·°λ‘ λ³΄μ¬μ£Όλ λ©μλλ asType ννλ‘ μ§λλ€. | ||
- ex) `asList` | ||
- κ°μ²΄μ κ°μ κΈ°λ³Έ νμ κ°μΌλ‘ λ°ννλ λ©μλμ μ΄λ¦μ λ³΄ν΅ `typeValue` ννλ‘ μ§λλ€. | ||
- ex) `intValue` | ||
- μ μ ν©ν°λ¦¬ | ||
- ex) `from`, `of`, `valueOf`, `instance`, `getInstance`, `newInstance`, `getType`, `newType` | ||
|
||
### **νλ** | ||
|
||
- νλ μ΄λ¦μ ν΄λμ€, μΈν°νμ΄μ€, λ©μλ μ΄λ¦μ λΉν΄ λ λͺ ννκ³ λ μ€μνλ€. | ||
- `boolean` νμ μ νλ μ΄λ¦μ λ³΄ν΅ `boolean` μ κ·Όμ λ©μλμμ μ λ¨μ΄λ₯Ό λΊ ννμ΄λ€. | ||
- ex) `initialized`, `composite` | ||
- λ€λ₯Έ νμ μ νλλΌλ©΄ λͺ μ¬λ λͺ μ¬κ΅¬λ₯Ό μ¬μ©νλ€. | ||
- ex) `height`, `digits`, `bodyStyle` | ||
- μ§μ λ³μλ νλμ λΉμ·νκ² μ§μΌλ©΄ λλλ°, μ‘°κΈ λ λμ¨νλ€. | ||
|
||
## **π‘ ν΅μ¬ μ 리** | ||
|
||
- νμ€ λͺ λͺ κ·μΉμ 체ννμ¬ μμ°μ€λ½κ² λ² μ΄ λμ€λλ‘ νμ. | ||
- μ² μ κ·μΉμ μ§κ΄μ μ΄λΌ λͺ¨νΈν λΆλΆμ΄ μ μ λ° λ°ν΄, λ¬Έλ² κ·μΉμ λ 볡μ‘νκ³ λμ¨νλ€. | ||
- μ€λ«λμ λ°λΌμ¨ κ·μΉκ³Ό μΆ©λνλ€λ©΄ κ·Έ κ·μΉμ λ§Ήμ νμ§ λ§κ³ μμμ΄ μ΄λλλλ‘ λ°λ₯΄μ. |