fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.util.stream.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main(String[] args) {
  11. Set<String> strings = Arrays.asList("c", "a", "b", "z", "y", "x", "p", "q", "r", "f", "g", "h")
  12. .stream()
  13. .sorted()
  14. .collect(Collectors.toSet());
  15. System.out.println(strings.getClass());
  16. System.out.println(strings);
  17. }
  18. }
Success #stdin #stdout 0.12s 4386816KB
stdin
Standard input is empty
stdout
class java.util.HashSet
[p, a, q, b, r, c, f, g, h, x, y, z]