Advertisement
myshkin1

Untitled

Apr 19th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import java.util.Set;
  2. import java.util.stream.Collectors;
  3. import java.util.stream.Stream;
  4.  
  5. class Test {
  6. public static void main(String[] args) {
  7. Stream<String> stream = Stream.of("w", "o", "l", "f").parallel();
  8. Set<String> set = stream.collect(Collectors.toSet());
  9. System.out.println(set); // [f, w, l, o]
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement