StringJoiner was introduced in Java 8. It joins String separated by a delimiter, starting with a supplied prefix and ending with a supplied suffix.
Let us understand it by looking into the below examples.
Join Strings using only delimiter
Join String with delimiter, prefix and suffix
Merging two joiners
The static method join of String internally uses StringJoiner.