Skip to content

Instantly share code, notes, and snippets.

@TonyRenHK
Created July 28, 2018 08:31
Show Gist options
  • Save TonyRenHK/fe04dce7ad9931c31d0a7956cc545777 to your computer and use it in GitHub Desktop.
Save TonyRenHK/fe04dce7ad9931c31d0a7956cc545777 to your computer and use it in GitHub Desktop.
Java Study Note
List<String> list = Arrays.asList("one", "two", "three");
//diamond operator
List<String> list = new ArrayList<>();
list.add("one");
list.add("two");
list.add("three");
List<String> list = Stream.of("one", "two", "three").collect(Collectors.toList());
List<String> list = List.of("one", "two", "three");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment