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

[20210323] Java Stream, Exception #75

Open
JuHyun419 opened this issue Mar 23, 2021 · 0 comments
Open

[20210323] Java Stream, Exception #75

JuHyun419 opened this issue Mar 23, 2021 · 0 comments
Labels

Comments

@JuHyun419
Copy link
Owner

JuHyun419 commented Mar 23, 2021

Java Stream

  • int[] to Integer List
        List<Integer> list = Arrays.stream(nums)
                .boxed()
                .collect(Collectors.toList());

  • List removeIf
// 빈도수 1 초과(2이상)
list.removeIf(i -> Collections.frequency(list, i) > 1);

  • List sum()
list.stream().mapToInt(i -> i).sum();

Exception

정리

@JuHyun419 JuHyun419 added the Java label Mar 23, 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