We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
링크
주의 자바 9까지만 해도 파라미터 3개가 넘어가면 ListN으로 나왔는데, 자바 11부터는 10개부터라고 함!
제가 이해한 거 👉 이렇게 일정 파라미터 이상 호출 시 ListN으로 나오는 건 메모리 구조를 절약하기 위해서! 왜냐하면 List.of()는 필드 기반 구현이 있고, 내부적으로 힙 공간을 덜 사용하기에 요소 자체가 필요하다면 List.of()가 적절하기 때문이라고 함!
출처
Memory Layout of Objects in Java
출처 출처
비밀 푸는데 도움이 되셨으면 좋겠습니다...!!! 덕분에 찾아보면서 공부 많이 됐어요ㅎㅎ
The text was updated successfully, but these errors were encountered:
No branches or pull requests
영준님이 알고 싶으신 List.of()의 비밀🗝️
링크
주의 자바 9까지만 해도 파라미터 3개가 넘어가면 ListN으로 나왔는데, 자바 11부터는 10개부터라고 함!
왜 list.of() 메소드 파라미터가 3개 이상이면 ImmutableCollections$ListN이 될까?
제가 이해한 거 👉 이렇게 일정 파라미터 이상 호출 시 ListN으로 나오는 건 메모리 구조를 절약하기 위해서! 왜냐하면 List.of()는 필드 기반 구현이 있고, 내부적으로 힙 공간을 덜 사용하기에 요소 자체가 필요하다면 List.of()가 적절하기 때문이라고 함!
출처
영준님이 주신 자바의 메모리 구조 링크
Memory Layout of Objects in Java
List.of() method란?
비밀을 풀어보자!
출처
출처
참고) Arrays.asList()와 List.of()의 비교
출처
비밀 푸는데 도움이 되셨으면 좋겠습니다...!!!
덕분에 찾아보면서 공부 많이 됐어요ㅎㅎ
The text was updated successfully, but these errors were encountered: