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
| Parameter | Description |
|---|---|
| separator | Required. The separator used to join the elements |
| elements | Required. Elements to be joined |
Technical Details
| Returns: | A new String , separated by the specified separator |
|---|---|
| Java version: | 1.8 |