- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a string from a Java Array?
You can convert an array of Strings to a single array using the collect() method.
Example
import java.util.Arrays; import java.util.stream.Collectors; public class CreatngStringFromArray { public static void main(String args[]) { String [] myArray = {"Welcome", "to", "Tutorialspoint"}; String str = Arrays.stream(myArray).collect(Collectors.joining(" ")); System.out.println(str); } }
Output
Welcome to Tutorialspoint
- Related Articles
- Java Program to create Stream from a String/Byte Array
- How to create a string from a Java ArrayList?
- Java Program to create Character Array from String Objects
- How to create a subarray from another array in Java
- Java Program to create a boolean variable from string
- Java Program to create a BigDecimal from a string type value
- Java Program to Create String from Contents of a File
- How to create a series from a NumPy array?
- How to parse a string from a JavaScript array?
- How to convert a Double array to a String array in java?
- How do I create a Java string from the contents of a file?
- How to create a hash from a string in JavaScript?
- How to create a function from a string in JavaScript?
- How to create a generic array in java?
- Golang Program to create a string array that takes inputs from users.

Advertisements