Constructor reference는 target SAM이 생성 인수를 결정한다
Type::new만으로 어느 constructor를 고를지 정하지 않고 target signature가 overload 선택을 제공합니다.
| target | reference | 선택 결과 |
|---|---|---|
| Supplier<User> | User::new | User() |
| Function<String,User> | User::new | User(String) |
| BiFunction<String,Integer,User> | User::new | User(String,int) |
| IntFunction<String[]> | String[]::new | new String[n] |
핵심: array constructor reference도 길이 인수와 결과 배열 타입을 연결합니다.