int[] nums=new int[n];
String s=Arrays.stream(nums1).mapToObj(a->String.valueOf(a)).collect(Collectors.joining());
s=Arrays.stream(nums1).mapToObj(a->String.valueOf((char)('a'+a))).collect(Collectors.joining());
增加分隔符
int[] nums=new int[n];
String s=Arrays.stream(nums1).mapToObj(a->String.valueOf(a)).collect(Collectors.joining(" "));
String 转 int[]
String s;
int[] nums=s.chars().map(a->a-'0').toArray();