JAVA常用方法

来源:互联网 发布:华润置地 知乎 面试 编辑:程序博客网 时间:2024/05/19 06:16

打印数组里面的所有元素:
System.out.println(Arrays.deepToString(arr));

copy数组
public static int[] copyOf(int[] original, int newLength) {
int[] copy = new int[newLength];
System.arraycopy(original, 0, copy, 0, Math.min(original.length, newLength));
return copy;
}

from :http://www.programcreek.com/

0 0
原创粉丝点击