Skip to content

Instantly share code, notes, and snippets.

@mingliangguo
Last active November 29, 2020 02:23
Show Gist options
  • Save mingliangguo/a73b3255e60878fc6f3ed20585fa5f44 to your computer and use it in GitHub Desktop.
Save mingliangguo/a73b3255e60878fc6f3ed20585fa5f44 to your computer and use it in GitHub Desktop.
Java lambda java
int[] nums = new int[]{3, 5, 9, 2, 6};
nums = IntStream.of(nums).boxed().sorted(Comparator.reverseOrder()).mapToInt(i -> i).toArray();
List<Integer> list = new ArrayList<>();
int[] arr = list.stream().mapToInt(i -> i).toArray();
// convert array to string
Arrays.toString(new int[]{1, 2, 3});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment