Last active
June 8, 2020 09:02
-
-
Save SiAust/8bbebf3f3e9d5e8a8c15b898aa58fa62 to your computer and use it in GitHub Desktop.
while loop and streams
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To get a int[] from a single space separated string | |
| int[] range = Stream.of(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray(); | |
| // Nice way to do a simple loop | |
| while (n-- > 0) { // nice way to do a loop, postfix decrement | |
| // do something | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment