Java tutorial
import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static void main(String[] args) { // collect as typed array Stream<String> words = Stream.of("All", "men", "are", "created", "equal"); final String joinedWords = words.collect(Collectors.joining(" ")); System.out.println(joinedWords); } }