标题日期:2020/1/14
标题功能:数组的复制
标题IDE:Intellij IDEA
package test.demo;
public class Test {
public static void main(String[] args){
int[] a = new int[3];
a[0] = 1;
a[1] = 2;
a[2] = 3;
int i;
int[] b = new int[a.length];
int[] c = new int[a.length];
b = a.clone();
System.arraycopy(a,0,c,0,a.length);
for(i=0;i<b.length;i++)
System.out.println(b[i]);
for(i=0;i<c.length;i++)
System.out.println(c[i]);
}
}