package com.atguigu;public class fuzhi { public static void main(String[] args) { int[] array1=new int[]{2,3,5,7,11,13,17,19};//靜態初始化 int[] array2; fo ...
package com.atguigu;
public class fuzhi {
public static void main(String[] args) {
int[] array1=new int[]{2,3,5,7,11,13,17,19};//靜態初始化
int[] array2;
for(int i=0;i<array1.length;i++){
System.out.print(array1[i]+"\t");
}
array2=array1;
System.out.println();
for(int i=0;i<array2.length;i++){
System.out.print(array2[i]+"\t");
}
for(int i=0;i<array2.length;i++){
if(i%2==0){
array2[i]=i;
}
}
System.out.println();
for(int i=0;i<array1.length;i++){
System.out.print(array1[i]+"\t");
}
}
}