public class test {
public static void main(String[] args) {
//反转数组
int[] arrays = {1,2,3,4,5};
int[] result = new int[arrays.length];
for (int i = 0,j = arrays.length-1; i < arrays.length; i++,j--) {
result[j] = arrays[i];
}
for (int array : result) {
System.out.print(array+"\t");
}
}
}
标签:Java,int,反转,arrays,length,result,数组
From: https://www.cnblogs.com/exact/p/16792840.html