若是是 「字符串數組」 轉 「字符串」,只能經過循環,沒有其它方法數組
String[] str = {"abc", "bcd", "def"};
StringBuffer sb = new StringBuffer();
for(int i = 0; i < str.length; i++){
sb. append(str[i]);
}
String s = sb.toString();
若是是 「字符數組」 轉 「字符串」 能夠經過下邊的方法app
char[] data={'a','b','c'};
String s=new String(data);ide