item 30) 이왕이면 제네릭 메서드로 만들라
제네릭 메서드

public static <E> Set<E> union(Set<E> s1, Set<E> s2) {
Set<E> result = new HashSet<>(s1);
result.addAll(s2);
return result;
}제네릭 싱글턴 팩토리
항등 함수
재귀적 타입 한정 명시
Last updated