Java 8 added join() method in
java.lang.String class to join Strings elements, It internally uses StringJoiner class for joining Strings elements.
It has two overloaded versions of join() methods. One accepts CharSequence elements and other accepts Iterable of CharSequence, it means you can pass List of String or an Array of String. Refer below three examples to join String values, list of string and an array of string.