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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
1. 타입 매개변수와 와일드카드 차이
타입 매개변수 (
<T>)읽기 + 쓰기모두 가능와일드카드 (
?)set,add는null만 가능)2. 타입 추론과 복잡도
<T>는 컴파일러가 타입을 추론해야 해서,타입이 다르면 실패할 수 있음
<?>는 타입 추론 필요 없음 → 실패할 일 없음→ 그래서 public API에 쓰기 간편함
3. 왜 swap은 와일드카드+도우미를 쓰는가
<?>덕분에 직관적인 API 제공<E>덕분에 읽고 쓰는 작업을 안전하게 처리4. 결론 요약
Beta Was this translation helpful? Give feedback.
All reactions