Closed kjsu0209 closed 3 years ago
이중 콜론 연산자(::)를 통해서 Object의 toString을 호출하여, values가 반환한 배열의 문자열을 맵에 추가하는 것이 아닐까 추측을 해봅니다!
http://wiki.sys4u.co.kr/pages/viewpage.action?pageId=7766725
http://yoonbumtae.com/?p=2776 첫 예제를 참조하시기 바랍니다.
forEach의 첫 번째 구문은 람다식이 x를 파라미터로 넘기고 println(x)이 그 파라미터를 받는 과정에서 x를 두 번 사용하게 됩니다. 람다식이 건네는 파라미터와 받는 쪽의 파라미터가 동일할 때, 두 번째 구문처럼 System.out::println으로 줄여쓸 수 있습니다.
216p 코드 보면 toMap 메서드 인자로
Object::toString
이 있는데 무슨 의미일까요?? 🤔