public class Str { public static void main(String[] args) { //数组 int [] arrNum={1,2,3,4,5,6}; String result1=arrayTostring(arrNum); System.out.println(result1); } public static String arrayTostring(int [] arrNum) { String result=" "; result+="["; for (int i = 0; i < arrNum.length ; i++) { result+=arrNum[i]; }return result+"]"; } }
标签:String,int,public,Stirng,result,数组,arrNum From: https://www.cnblogs.com/haha1988/p/17494935.html