Last active
November 11, 2015 16:49
-
-
Save yutax77/699db97ec0cc9fcd11eb to your computer and use it in GitHub Desktop.
Initialize the list or array using Stream(Java8) ref: http://qiita.com/yutax77/items/ea1412cc0522435ef101
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 = Stream.generate(() -> "hoge").limit(10).collect(Collectors.toList()); |
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
String[] array = Stream.generate(() -> "hoge").limit(10).toArray(String[]::new); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment