Created
July 28, 2018 08:31
-
-
Save TonyRenHK/fe04dce7ad9931c31d0a7956cc545777 to your computer and use it in GitHub Desktop.
Java Study Note
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
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