- 이름이 있음, 호출할때 Singleton, 반환값 자료형의 하위 자료형 객체를 반환 가능하다.
- 형인자 자료형 객체를 만들때 편함
public static <K, V> HashMap<K, V> new Instance() {
return new HashMap<K, V>();
}
Map<String, List<String>> m = hashMap.newInstance();
- 단점, 하위 클래스 생성 불가. 새로운 인스턴스는 생성 불가하기 때문에
- 정적 팩터리 메서드가 다른 정적 메서드와 확연히 구분되지 않음