Skip to content

Instantly share code, notes, and snippets.

@yutax77
Last active November 11, 2015 16:49
Show Gist options
  • Save yutax77/699db97ec0cc9fcd11eb to your computer and use it in GitHub Desktop.
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
List<String> list = Stream.generate(() -> "hoge").limit(10).collect(Collectors.toList());
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