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

About Parallel Streams #61

Open
antaow opened this issue Jun 30, 2022 · 0 comments
Open

About Parallel Streams #61

antaow opened this issue Jun 30, 2022 · 0 comments

Comments

@antaow
Copy link

antaow commented Jun 30, 2022

Bruce,
When I read your chapter on Concurrent Programming,In the section of Parallel Streams, For the isPrime() method in ParallelPrime.java, I tried to use (long) Math.sqrt(n) but the compiler gives an error,When I write the cast of (int) Math.sqrt(n) like this, it does not report an error ,I think this is a code error, because the parameter of the source code is int primetive type.
Please have a look.

CleanShot 2022-06-30 at 14 00 30@2x

CleanShot 2022-06-30 at 14 05 42@2x

My java version is "17.0.1" 2021-10-19 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant