import java.util.stream.Collectors; import java.util.stream.IntStream; public class A { static String hi = "the quick brown fox jumps over the lazy dog"; static String name = IntStream.range(0, hi.length()) .parallel() .map(l -> hi.charAt(l)) .filter(s -> s != ' ') .mapToObj(c -> Character.toString((char) c)) .sorted() .collect(Collectors.joining()); public static void main(String[] args) { System.out.println(name); } }