我随便写了一个,方法不一定很好,仅作参考靠
public class test1 {
public static void main(String[] atgs) {
// TODO Auto-generated method stub
int[] arr = {1,2,3,4,5};
System.out.print("\"");
for(int x = 0; x<arr.length; x++)
{
if(x!=arr.length-1)
System.out.print(arr[x]+",");
else
System.out.print(arr[x]);
}
System.out.print("\"");
}
} |