数组-数组翻转(进阶)
public class ArrayExercise02{
public static void main(String[] args){
//数组的翻转
//定义一个原数组
int arr1[] ={11,22,33,44,55,66};
//定义一个翻转数组
int arr2[] = new int[arr1.length];
//循环遍历交换
for (int i=0,j=arr1.length-1;j>=0 ;i++,j--) {
arr2[i]=arr1[j];
}
//循环输出
for (int i=0;i<arr1.length ;i++ ) {
System.out.print(arr2[i]+" ");
}
}
}