int[] arr = {33,22,11,44,66,55};
StringBuffer sb =new StringBuffer();
sb.append(Arrays.toString(arr));
System.out.println(sb); //数组转字符串
System.out.println(sb.length()); //数组转字符串
System.out.println(sb.capacity()); //数组转字符串
运行结果是[33, 22, 11, 44, 66, 55]
24
34
不是应该.capacity()比.length()大16的吗?搞不懂,同学都睡了,求助 |
|