Created
September 15, 2017 08:59
-
-
Save hendrysuwanda/48cf8ec150d3ef4d44db0d2e38dec27c to your computer and use it in GitHub Desktop.
How to using java's lambda expression to print an array
This file contains 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
Arrays.stream(values).forEach(i -> System.out.println(Integer.toUnsignedString(i, 16))); | |
Arrays.stream(values) | |
.mapToObj(i -> Integer.toUnsignedString(i, 16)) | |
.forEach(System.out::println); | |
String[] nums = {"three","two","one"}; | |
Arrays.stream(nums).forEach(num -> System.out.println(num)); | |
IntStream.of(values) | |
.mapToObj(i -> Integer.toUnsignedString(i, 16)) | |
.forEach(System.out::println); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment