Skip to content
Snippets Groups Projects
Commit 72711c62 authored by Stuart Marks's avatar Stuart Marks
Browse files

Change exercise 21 solution to use IntStream instead of LongStream.

parent 31904ddc
No related branches found
No related tags found
No related merge requests found
......@@ -633,7 +633,7 @@ public class Exercises {
//UNCOMMENT//BigInteger result = BigInteger.ONE; // TODO
//BEGINREMOVE
BigInteger result =
LongStream.rangeClosed(1L, 21L)
IntStream.rangeClosed(1, 21)
.mapToObj(n -> BigInteger.valueOf(n))
.reduce(BigInteger.ONE, (m, n) -> m.multiply(n));
//ENDREMOVE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment