public class FanZhuan {标签:20,temp,int,反转,40,60,数组,public From: https://www.cnblogs.com/nulicheng/p/17847606.html
public static void main(String[] args) {
int[] a = {10, 20, 30, 40, 50, 60};
for (int i= 0,j=a.length-1; i <j ; i++,j--) {
int temp =a[j]; //建立一个零时变量 int=temp
a[j] =a[i];
a[i] = temp;
}
//遍历查看是否成功
for (int i = 0; i <a.length ; i++) {
System.out.println(a[i]); //结果为60,50,40,30,20,10
}
}
}