Skip to content
New issue

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

[20210225] Java Stream #50

Open
JuHyun419 opened this issue Feb 25, 2021 · 0 comments
Open

[20210225] Java Stream #50

JuHyun419 opened this issue Feb 25, 2021 · 0 comments
Labels

Comments

@JuHyun419
Copy link
Owner

int[] to Set, List ...

Set<Integer> set =
        Arrays.stream(nums).boxed().collect(Collectors.toCollection(HashSet::new));
  • toCollection(): 컬렉션 프레임워크의 특정 구현체로 생성 가능
  • toSet(), toList(), toMap() 등은 구현체 X
  • boxed(): 박싱
    • int -> Integer
    • long -> Long
    • double -> Double
@JuHyun419 JuHyun419 added the Java label Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant