Java String join() method

Facebooktwitterredditpinterestlinkedinmailby feather

Java String join() method returns a joined String with given delimiter

Syntax:

Parameters:

delimiter: char value to be added with each element

elements: char value to be attached with delimeter

Returns

It returns joined String or new String with delimeter

Throws

It throws NullPointerException if the Delimiter or element is null.

Java String join() method example 1

Output:

Java String join() method example 2

Output:

Java String join()method example 3

Output:

Facebooktwitterredditpinterestlinkedinmailby feather

Leave a Comment