
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements