The official documentation for what you want to do: https://docs.oracle.com/javase/8/docs/api/java/util/stream/Collectors.html

 // Accumulate names into a List
 List<String> list = people.stream().map(Person::getName).collect(Collectors.toList());

 // Convert elements to strings and concatenate them, separated by commas
 String joined = things.stream()
                       .map(Object::toString)
                       .collect(Collectors.joining(", "));

For your example, you would need to do this:

 // Convert elements to strings and concatenate them, separated by commas
 String joined = persons.stream()
                       .map(Person::getName) // This will call person.getName()
                       .collect(Collectors.joining(", "));

The argument passed to Collectors.joining is optional.

Answer from Thomas Betous on Stack Overflow
🌐
Davidvlijmincx
davidvlijmincx.com › home › java › java stream join lists
Java Stream join lists
March 10, 2022 - The easiest way to join two lists with Streams is by using the Stream.concat(Stream a, Stream b) method. The method takes two Stream instances as parameters and puts the second Stream behind the first Stream. The result is a new list of strings with the content of both lists.
🌐
HowToDoInJava
howtodoinjava.com › home › java 8 › join or append stream elements in java
Join or Append Stream Elements in Java
December 13, 2024 - It works well when converting a collection or array of strings to a single string. The String.join() requires a collection or array as input, so we must convert the stream into a list using toList().
🌐
Javaprogramto
javaprogramto.com › 2020 › 12 › java-8-stream-join-string.html
Java 8 Streams - Join or Append Stream of Strings using Collectors.joining() JavaProgramTo.com
November 26, 2021 - Along with the joining, this method does the conversion from java 8 stream to string object with the default delimiter. Collectors.joining() method does concatenate the list of values or list of strings or stream of values or strings into a ...
🌐
amitph
amitph.com › home › java › convert list to concatenated string with delimiter in java
List of Strings to Concatenated String with Delimiter in Java | amitph
November 22, 2024 - String output = Stream.of("Convert", "List", "of", "Strings", "To", "String") .collect(Collectors.joining(",")); System.out.println(output); // Output: // Convert,List,of,Strings,To,StringCode language: Java (java) Moreover, you can also add a prefix and suffix to the concatenated string.
🌐
Coderwall
coderwall.com › p › im4lja › joining-objects-into-a-string-with-java-8-stream-api
Joining Objects into a String with Java 8 Stream API (Example)
July 17, 2023 - #stream · You can leverage Java 8 Collectors to concatenate some objects into a string separated by a delimiter: For example: List<Integer> numbers = Arrays.asList( 4, 8, 15, 16, 23, 42 ); return numbers.stream() .map( n -> n.toString() ) .collect( ...
🌐
Medium
medium.com › @AlexanderObregon › javas-stream-concat-method-explained-4b5fab338fa2
Java’s Stream.concat() Method Explained | Medium
February 3, 2025 - The returned stream consists of all elements from a, followed by all elements from b. A common use case is combining two lists into a single stream. import java.util.stream.Stream; import java.util.List; public class StreamConcatExample { public static void main(String[] args) { List<String> firstList = List.of("Cyan", "Magenta", "Teal"); List<String> secondList = List.of("Amber", "Indigo", "Maroon"); Stream<String> firstStream = firstList.stream(); Stream<String> secondStream = secondList.stream(); Stream<String> mergedStream = Stream.concat(firstStream, secondStream); mergedStream.forEach(System.out::println); } }
🌐
Tabnine
tabnine.com › home › code library
Code Library - Tabnine
July 25, 2024 - Get the answers and suggestions you need from our AI code assistant. Get started in minutes with a free 90 day trial of Tabnine Pro.
Find elsewhere
🌐
YouTube
youtube.com › douglas schmidt
Concatenating a List of String Objects Together Via Java Streams - YouTube
This video hows several techniques for concatenating a List of String objects together multiple times via Java Streams, focusing particularly on the use of f...
Published: January 23, 2023
Views: 160
🌐
TechEmpower
techempower.com › home › efficient multiple-stream concatenation in java
Efficient multiple-stream concatenation in Java – TechEmpower
December 11, 2023 - We can think of the calls to Stream.concat(a, b) as forming a binary tree. At the root is the concatenation of all the input streams. At the leaves are the individual input streams.
🌐
ConcretePage
concretepage.com › java › jdk-8 › java-8-concat-streams-lists-sets-arrays-example
Java 8 Concat Streams, Lists, Sets, Arrays Example
The resulting stream will be parallel if any of the two streams is parallel. Now find the examples to use concat(). ... Here we will concatenate two stream instances using concat(). ConcatStreamsDemo.java · package com.concretepage; import java.util.stream.Stream; public class ConcatStreamsDemo { public static void main(String[] args) { Stream&ltString&gt s1 = Stream.of("AA", "BB", "CC"); Stream&ltString&gt s2 = Stream.of("AA", "BB", "DD"); Stream&ltString&gt s = Stream.concat(s1, s2); s.forEach(e-&gtSystem.out.print(e+" ")); //Remove duplicates using distinct() s1 = Stream.of("AA", "BB", "CC"); s2 = Stream.of("AA", "BB", "DD"); System.out.println("\nRemove duplicates using distinct()"); s = Stream.concat(s1, s2).distinct(); s.forEach(e-&gtSystem.out.print(e+" ")); } } Output
🌐
Java Guides
javaguides.net › 2024 › 09 › java-8-convert-list-of-strings-to-single-string.html
Java 8 – Convert List of Strings to a Single String
September 9, 2024 - In Java 8, converting a list of strings into a single string is easy with the Stream API and Collectors.joining(). You can concatenate strings with or without a delimiter, and even add a prefix and suffix to the result.
🌐
GeeksforGeeks
geeksforgeeks.org › java › stream-concat-java
Stream.concat() in Java - GeeksforGeeks
January 23, 2026 - import java.util.stream.Stream; class GFG { public static void main(String[] args) { Stream<String> s1 = Stream.of("Geeks"); Stream<String> s2 = Stream.of("For"); Stream<String> s3 = Stream.of("Geeks"); Stream.concat(Stream.concat(s1, s2), s3) ...
🌐
Baeldung
baeldung.com › home › java › java string › concatenating strings in java
Concatenating Strings in Java | Baeldung
May 8, 2025 - Java provides a substantial number of methods and classes dedicated to concatenating Strings.
🌐
DZone
dzone.com › coding › java › concatenating strings in java 8
Concatenating Strings in Java 8
August 8, 2017 - It delegates the calls to a slightly ... just concatenating strings with a parametrized delimiter. As the Javadoc states · StringJoiner is used to construct a sequence of characters separated by a delimiter and optionally starting with a supplied prefix and ending with a supplied suffix. If we want to use StringJoiner with a suffix and prefix, we will have to use it directly or wrapped by another class. People experienced with Java 8 Streams most probably ...
🌐
HowToDoInJava
howtodoinjava.com › home › java 8 › java 8 stream.concat(): how to combine streams?
Java 8 Stream.concat(): How to Combine Streams?
May 27, 2024 - import java.util.ArrayList; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; public class Main { public static void main(String[] args) { Stream<Employee> stream1 = getEmployeeListOne().stream(); Stream<Employee> stream2 = getEmployeeListTwo().stream(); Stream<Employee> resultingStream = Stream.concat(stream1, stream2) .filter(distinctByKey(Employee::getFirstName)); System.out.println( resultingStream.collect(Collectors.toList()) ); }
🌐
LabEx
labex.io › tutorials › java-how-to-concatenate-streams-in-java-462122
How to concatenate streams in Java | LabEx
Stream<String> conditionalStream = Stream.concat( list1.stream().filter(s -> s.length() > 3), list2.stream().filter(s -> s.startsWith("J")) ); public <T> Stream<T> concatenateStreams(Stream<T>... streams) { return Stream.of(streams).flatMap...