数组转字符串 Java

数组转字符串 Java


 public class ArraytoString {
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
		String[] arr = { "0", "1", "2", "3", "4", "5" };
		// 遍历
		StringBuffer str5 = new StringBuffer();
		for (String s : arr) {
		    str5.append(s);
		}
		System.out.println(str5.toString()); // 012345
	}

}

你可能感兴趣的:(数组转字符串 Java)