Java创建一个字符串


Java创建一个字符串

import java.util.Arrays;

import java.util.stream.Collectors;



public class CreatngStringFromArray {

   public static void main(String args[]) {



      String [] myArray = {"Welcome", "to", "codingdict"};

      String str = Arrays.stream(myArray).collect(Collectors.joining(" "));

      System.out.println(str);

   }

}