3 ms·Yes, you do. :-) Alternative Java 8 solution: int total = IntStream.rangeClosed(1, 10).map(x -> x*x).sum();by smarks 12y agoYes, you do. :-) Alternative Java 8 solution: int total = IntStream.rangeClosed(1, 10).map(x -> x*x).sum();