3 ms·
As someone who last used Java 5, that's really amazing! Need to write some more modern Java one of these days.
by sanderjd 12y ago
As someone who last used Java 5, that's really amazing! Need to write some more modern Java one of these days.
- smarks 12y agoYes, you do. :-) Alternative Java 8 solution: int total = IntStream.rangeClosed(1, 10).map(x -> x*x).sum();