bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java String join() Method

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind Java String join() Method?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___ fruits = String.join(" ", "Orange", "Apple", "Mango");
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The join() method joins one or more strings with a specified separator.
Definition and Usage
Java String join() Method

❮ String Methods

Example

String fruits = String.join(" ", "Orange", "Apple", "Mango");
System.out.println(fruits);

Definition and Usage

The join() method joins one or more strings with a specified separator.

One of the following

public String join(CharSequence
separator , CharSequence...
elements )
public String join(CharSequence
separator , Iterable
elements )

Parameter Values

ParameterDescription
separatorRequired. The separator used to join the elements
elementsRequired. Elements to be joined

Technical Details

Returns:A new String , separated by the specified separator
Java version:1.8

Previous

Java String isEmpty() Method

Next

Java String lastIndexOf() Method